diff --git a/locale/fr.php b/locale/fr.php index 109c50329..1d3a5f996 100644 --- a/locale/fr.php +++ b/locale/fr.php @@ -1,891 +1,911 @@ AVideo! is an video-sharing website, The service was created by Daniel Neto in march 2017.

The software allow you to upload, view, share and comment on videos, and it makes use of WebM and H.264/MPEG-4 AVC to display a wide variety of user-generated and corporate media videos.

Best of all, AVideo! is an open source solution that is freely available to everyone.

'] = "

AVideo ! Est un site de partage de vidéos, le service a été créé par Daniel Neto en mars 2017.

Le logiciel vous permet de télécharger, de visualiser, de partager et de commenter des vidéos, et il utilise WebM et H.264 / MPEG-4 AVC pour afficher une grande variété de vidéos multimédias générées par les utilisateurs et d'entreprise.

Le meilleur de tous, AVideo ! Est une solution open source qui est disponible gratuitement pour tous.

"; $t['A service error occurred: %s'] = "Une erreur de service s'est produite: %s"; $t['About AVideo!'] = "À propos de AVideo !"; $t['About'] = "À propos"; $t['Activate'] = "Activer"; $t['Active'] = "Actif"; $t['Ad'] = "PUB"; $t['Add to'] = "Ajouter à"; $t['Add Funds'] = "Ajouter des fonds"; $t['Ad Title'] = "Ajouter un titre"; $t['Admin Menu'] = "Menu d'administration"; $t['Add more user Groups'] = "Ajouter plus de groupes d'utilisateurs"; $t['Ads'] = "Publicités"; $t['Ads Form'] = "Formulaire d'annonces"; $t['Advanced Configuration'] = "Configuration avancée"; $t['Advanced configuration'] = "Configuration avancée"; $t['Advanced configurations are disabled'] = "Les configurations avancées sont désactivées"; $t['Advertising Manager'] = "Gestion de la publicité"; $t['Advertising Title'] = "Titre de la publicité"; $t['Alert'] = "Alerte"; $t['All'] = "Tous"; $t['Amount'] = "Quantité"; $t['An client error occurred: %s'] = "Une erreur du client s'est produite: %s"; $t['Anyone with this key can watch your live stream.'] = "Toute personne possédant cette clé peut regarder votre diffusion en direct."; $t['All categories'] = "Toutes catégories"; $t['Are you sure?'] = "Êtes-vous sûr ?"; $t['Audio only'] = "Audio seulement"; $t['Audios'] = "Audios"; $t['Audios and Videos'] = "Tous les médias"; $t['Audio-Gallery by Date'] = "Audio-Gallery par Date"; $t['Authenticated users can comment videos'] = "Les utilisateurs authentifiés peuvent commenter des vidéos"; $t['Authenticated users can upload videos'] = "Les utilisateurs authentifiés peuvent téléverser des vidéos"; $t['Autoplay'] = "Lecture automatique"; $t['Autoplay Next Video'] = "Lecture automatique du prochaine média"; $t['Autoplay Next Video URL'] = "Lien du prochain média à lire automatiquement"; $t['Autoplay Video on Load Page'] = "Lecture automatique de la vidéo sur la page de chargement"; $t['Autoplay ended'] = "Lecture automatique terminée"; $t['Autoplay next-video-order'] = "Lecture automatique de la prochaine vidéo demandée"; $t['Balance'] = "Porte monnaie"; $t['Balance Form'] = "Formulaire de solde"; $t['Both'] = "Les deux"; $t['Bottom'] = "Bas"; $t['Broadcast a Live Streaming'] = "Diffuser un streaming en direct"; $t['Brazilian Portuguese'] = "portugais brésilien"; $t['Broadcast a Live Streaming'] = "Diffuser un streaming en direct"; $t['Browse'] = "Feuilleter"; $t['Browse …'] = "Parcourir …"; $t['Browse Channels'] = "Parcourir les chaînes"; $t['By associating groups with this user, they will be able to see all the videos that are related to this group'] = "En associant des groupes à cet utilisateur, ils pourront voir toutes les vidéos liées à ce groupe"; $t['By linking groups to this video, it will no longer be public and only users in the same group will be able to watch this video'] = "En reliant des groupes à cette vidéo, elle ne sera plus publique et seuls les utilisateurs du même groupe pourront regarder cette vidéo"; $t['By name'] = "Par nom"; $t['Can Stream Videos'] = "Peut diffuser des vidéos"; $t['Can Upload Videos'] = "Peut téléverser des vidéos"; $t['Categories'] = "Catégories"; $t['Category'] = "Catégorie"; $t['Category Form'] = "Formulaire de catégorie"; $t['Category to display this Ad'] = "Catégorie pour afficher cette annonce"; $t['Center'] = "Centre"; $t['Category-Gallery'] = "Catégorie-Gallery"; $t['Change Playlist Name'] = "Changer le nom de la playlist"; $t['Change Style'] = "Changer le style"; $t['Channel'] = "Chaîne"; $t['Channels'] = "Chaînes"; $t['Channel Name'] = "Nom de la chaîne"; $t['Channel name already exists'] = "Nom de chaîne non disponible"; $t['Clean Name'] = "Identifiant (Slug)"; $t['Clean Title'] = "Identifiant (Slug)"; $t['Clear Cache Directory'] = "Nettoyer le cache"; $t['Click here if you agree to continue'] = "Cliquez ici si vous acceptez"; $t['Clicks'] = "Clics"; $t['Close'] = "Fermer"; $t['Color Legend'] = "Légende des couleurs"; $t['Comment'] = "Commentaire"; $t['Comment Form'] = "Formulaire de commentaire"; $t['Comment thumbs up - per Person'] = "Appréciations des commentaires - Par personne"; $t['Comments'] = "Commentaires"; $t['Compatibility Check'] = "Vérification de compatibilité"; $t['Configuration'] = "Configuration"; $t['Configure an Encoder URL'] = "Configurer une URL pour l'encodeur"; $t['Confirm'] = "Confirmer"; $t['Confirm New Password'] = "Confirmer le nouveau mot de passe"; $t['Confirm!'] = "Confirmé !"; $t['Confirmation password does not match'] = "Le mot de passe de confirmation ne correspond pas"; $t['Congratulations!'] = "Félicitations !"; $t['Congratulations'] = "Félicitations"; $t['Contact Us Today!'] = "Contactez-nous aujourd'hui !"; $t['Contact'] = "Nous contacter"; $t['Continue'] = "Continuer"; $t['Cost'] = "Prix"; $t['Could not move gif image file [%s.gif]'] = "Impossible de déplacer le fichier image gif [ %s.gif]"; $t['Could not move image file [%s.jpg]'] = "Impossible de déplacer le fichier image [ %s.jpg]"; $t['Copy to Clipboard'] = "Copier dans le presse-papier"; $t['Copy'] = "Copie"; $t['Created'] = "Créé"; $t['Create a New Play List'] = "Créer une nouvelle liste de lecture"; $t['Create an Advertising'] = "Créer une publicité"; $t['Create more translations'] = "Créer plus de traductions"; $t['Created'] = "Créé"; $t['Current Style & Theme'] = "Style et thème actuels"; $t['Dashboard'] = "Tableau de bord"; $t['Database-update needed'] = "Mise à jour de la base de données nécessaire"; $t['Date added'] = "Par date d'ajout"; $t['Date added (newest)'] = "Par date d'ajout (le plus récent)"; $t['Date added (oldest)'] = "Par date d'ajout (le plus ancien)"; $t['Default'] = "Par défaut"; $t['Delete'] = "Supprimer"; $t['Devices Stream Info'] = "Informations sur les périphériques de streaming"; $t['Description'] = "Description"; $t['Direct Import Local Videos'] = "Importation directe de vidéos locales"; $t['Disable AVideo Google Analytics'] = "Désactiver AVideo Google Analytics"; $t['Disable Youtube-Upload'] = "Désactiver Youtube-Upload"; $t['Disable right-click-prevention on video and allow downloading'] = "Désactiver la prévention du clic droit sur la vidéo et autoriser le téléchargement"; $t['Direct upload'] = "Téléversement rapide"; $t['Do not forget to save after choose your theme'] = "Après avoir choisi votre thème, il est impératif d'enregistrer vos changements en cliquant le bouton Enregistrer."; $t['Don´t like this video? Sign in to make your opinion count.'] = "Tu n'aime pas cette vidéo ? Connecte-toi pour que ton opinion compte :)"; $t['Down'] = "En bas"; $t['Download'] = "Télécharger"; $t['Download Video'] = "Télécharger la video"; $t['Downloading'] = "Téléchargement"; $t['Drag and drop to sort'] = "Faites glisser et déposez pour trier"; $t['Drop Here'] = "Déposer ici"; $t['Duration'] = "Durée"; $t['E-mail'] = "E-mail"; $t['E-mail Address'] = "Adresse e-mail"; $t['E-mail sent'] = "E-mail envoyé"; $t['E-mail Verified'] = "E-mail vérifié"; $t['E-mail Not Verified'] = "E-mail NON vérifié"; $t['Edit'] = "Modifier"; $t['Edit Video'] = "Modifier le média"; $t['Email can not be blank'] = "L'e-mail ne peut pas être vide"; $t['Embed'] = "Intégrer"; $t['Embeded'] = "Intégré"; $t['Enable WebCam Stream'] = "Activer le flux WebCam"; $t['Embed Stream'] = "Diffusion en direct intégrée"; $t['Enable SMTP'] = "Activer SMTP"; $t['Enable SMTP Auth'] = "Activer l'authentification SMTP"; $t['Encoder Network'] = "Réseau d'encodeur"; $t['Encoder URL'] = "URL de l'encodeur"; $t['Encoding'] = "Codage"; $t['Encoding mp4 error'] = "Encodage erreur mp4"; $t['Encoding xmp3 error'] = "Erreur d'encodage xmp3"; $t['Encoding xogg error'] = "Codage de l'erreur xogg"; $t['Encoding xwebm error'] = "Encoder l'erreur xwebm"; $t['English'] = "Anglais"; $t['Error'] = "Erreur"; $t['Error on re-encoding!'] = "Erreur lors du ré-encodage !"; $t['Error!'] = "Erreur !"; $t['Finish on'] = "Terminer sur"; $t['First Page Mode'] = "Mode Première Page"; $t['First'] = "Premier"; $t['For faster encode, download your own encoder'] = "Pour un encodage plus rapide, téléchargez votre propre encodeur"; // About page $t['For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen.'] = "Car tout est de lui, et par lui, et pour lui. À lui la gloire pour l’éternité ! Amen."; $t['Apostle Paul in'] = 'Apôtre Saint-Paul dans'; $t['Romans 11:36'] = 'l\'Épître aux Romains (11:36)'; $t['Main Site'] = 'Site officiel d\'AVideo'; $t['Demo Site'] = 'Démonstration'; $t['Tutorials Site'] = 'Tutoriaux'; $t['Issues and requests Site'] = 'Soumettre une demande'; $t['French'] = "français"; $t['From'] = "De"; $t['Get imgage error'] = "Obtenir une erreur d'imgage"; $t['Go Back'] = "Revenir en arrière"; $t['Go back to the main page'] = "Revenir sur la page d'accueil"; $t['Go to manager videos page!'] = "Aller à la page du manager des vidéos !"; $t['Google Ad Sense'] = "Google AdSense"; $t['Group'] = "Groupe"; $t['Groups that can see this video'] = "Groupes ayant accès à cette vidéo"; $t['Groups That Can See This Stream'] = "Groupes ayant accès cette diffusion en direct"; $t['Head Code'] = "Code personnalisé"; $t['Help'] = "Aide"; $t['Hide Replies'] = "Masquer les réponses"; $t['History'] = "Historique"; $t['How Much?'] = "Combien ?"; $t['I forgot my password'] = "Mot de passe oublié ?"; $t['I would humbly like to thank God for giving me the necessary knowledge, motivation, resources and idea to be able to execute this project. Without God\'s permission this would never be possible.'] = "Je voudrais humblement remercier Dieu de m'avoir donné les connaissances, la motivation, les ressources et l'idée nécessaires pour réaliser ce projet. Sans la permission de Dieu, cela ne serait jamais possible."; $t['I would like to share this video with you:'] = "Je voudrais partager cette vidéo avec toi:"; $t['ID'] = "ID"; $t['ID can not be empty'] = "L'identifiant ne peut pas être vide"; $t['ID can\'t be blank'] = "L'identifiant ne peut pas être vide"; $t['Icon'] = "Icône"; $t['Order'] = 'Ordre'; $t['If you can\'t view this video, your browser does not support HTML5 videos'] = "Si Vous ne pouvez pas visionner cette vidéo, ton navigateur ne prend pas en charge les vidéos HTML5."; $t['If you change your password the Server URL parameters will be changed too.'] = "Si tu modifie ton mot de passe, les paramètres de l'URL du serveur seront également modifiés."; $t['If you do not have curl, you can alternatively use a recent wget: '] = "Si vous n'avez pas curl, vous pouvez alternativement utiliser un wget récent:"; $t['Inactivate'] = "Inactiver"; $t['Inactive'] = "Inactif"; $t['Is Ad'] = "Est une annonce"; $t['is live'] = "En direct"; $t['Language'] = "Langue par défaut"; $t['Last'] = "Dernièrement"; $t['Last 30 Days'] = "Les 30 derniers jours"; $t['Last 7 Days'] = "Les 7 derniers jours"; $t['Left'] = "À gauche"; $t['Left Menu'] = "Menu gauche"; $t['Like this video? Sign in to make your opinion count.'] = "Tu aime cette vidéo ? Connecte-toi pour que ton opinion compte :)"; $t['Listed Transmition'] = "Transmition répertoriée"; $t['Live'] = "En direct"; $t['Live Chat'] = "Live Chat"; $t['LIVE NOW'] = "EN DIRECT"; $t['Live Video'] = "Vidéo en direct"; -$t['Loading...'] = "Chargement..."; +$t['Loading...'] = "Chargement …"; $t['Local File'] = "Fichier local"; $t['Login'] = "S'identifier"; $t['Logoff'] = "Se déconnecter"; $t['Make it public'] = "Rendre public"; $t['Make sure that the video you are going to download has a duration of less than %d minute(s)!'] = "Assure-toi que la vidéo que tu vas télécharger a une durée inférieure à %d minute(s) !"; $t['Manage Payouts'] = "Gérer les paiements"; $t['Manage Wallets'] = "Gérer les portes-monnaies"; $t['Manager Audios and Videos'] = "Gestionnaire Audios et vidéos"; $t['Manager Categories'] = "Catégories de gestionnaire"; $t['Manager Users'] = "Utilisateurs du gestionnaire"; $t['Message could not be sent'] = "Le message n'a pas pu être envoyé"; $t['Message sent'] = "Message envoyé"; $t['Message'] = "Message"; $t['Modified'] = "Modifié"; $t['Most Popular'] = "Les plus populaires"; $t['Most popular'] = "Les plus populaires"; $t['Most Watched'] = "Les plus regardées"; $t['Most watched'] = "Les plus regardées"; $t['My Account'] = "Mon compte"; $t['My Channel'] = "Ma chaîne"; $t['My list'] = "Ma liste"; $t['My videos'] = "Mes médias"; $t['Name'] = "Nom"; $t['Name can\'t be blank'] = "Le nom ne peut pas être vide"; $t['New Category'] = "Nouvelle catégorie"; $t['New Password'] = "Nouveau mot de passe"; $t['New User'] = "Nouvel utilisateur"; $t['New User Groups'] = "Nouveau groupe d'utilisateurs"; $t['Next'] = "Suivant"; $t['No'] = "Non"; $t['None (Parent)'] = "Aucun (Parent)"; $t['No data available in table'] = "Aucune donnée disponible"; $t['No matching records found'] = "Aucune recherches trouvées"; $t['No results found!'] = "Pas de résultat"; $t['Notify Subscribers'] = "Notifier Abonnés"; $t['On'] = "On"; $t['Only verified users can upload'] = "Seuls les utilisateurs vérifiés peuvent téléverser du contenu"; $t['Opacity'] = "Opacité"; $t['Original words found'] = "Des mots originaux trouvés"; $t['Page'] = "Page"; $t['Parent ID'] = "Identifiant Parent"; $t['Parent-Category'] = "Catégorie du parent"; $t['Password'] = "Mot de passe"; $t['Paste here the translated words'] = "Collez ici les mots traduits"; $t['Payout'] = "Paiment"; $t['Permanent Link'] = "Lien permanent"; $t['Permission denied'] = "Permission refusée"; $t['Permition denied'] = "Permission refusée"; $t['Play'] = "Lire"; $t['Play All'] = "Tout regarder"; $t['Playlist name?'] = "Nom de la playlist ?"; $t['Please login to proceed'] = "Connectez-vous pour continuer"; $t['Please sign in'] = "Merci de vous connecter"; $t['Plugin Form'] = "Formulaire de plugin"; $t['Plugins'] = "Plugins"; $t['Position'] = "Position"; $t['Preview'] = "Aperçu"; $t['Previous'] = "Précédent"; $t['Prints'] = "Impressions"; $t['Processing'] = "Traitement"; -$t['Processing...'] = "Traitement..."; +$t['Processing...'] = "Traitement …"; $t['Privacy'] = 'Confidentialité'; $t['Private'] = 'Privée'; $t['Public'] = "Publique"; $t['Public Video'] = "Vidéo publique"; $t['Allow Download'] = 'Autoriser le téléchargement'; $t['Category Icon'] = 'Icône de la catégorie'; $t['Upload Image'] = 'Téléverser l\'image'; $t['Background'] = 'Fond'; $t['Random'] = "Aléatoire"; $t['Re-encode Audio'] = "Re-encoder Audio"; $t['Re-encode Image'] = "Recodifier l'image"; $t['Re-encode Video'] = "Re-encoder la vidéo"; $t['Recommended resolutions'] = "Résolutions recommandées"; $t['Recover Password'] = "Récupérer mot de passe"; $t['Recover password could not be saved!'] = "Récupérer le mot de passe n'a pas pu être sauvegardé !"; $t['Recover password does not match'] = "Récupérer le mot de passe ne correspond pas"; $t['Recover password!'] = "Récupérer mot de passe !"; $t['Refresh'] = "Rafraîchir"; $t['Regular Configuration'] = "Configuration standard"; $t['Regular User'] = "Utilisateur standard"; $t['Remember me'] = "Rester connecté"; $t['Remove'] = "Retirer"; $t['Remove Autoplay Next Video'] = "Supprimer la lecture automatique suivante"; $t['Rename'] = "Renommer"; $t['Reply'] = "Répondre"; $t['Request Payout'] = "Demande de paiement"; $t['Reset Key'] = "Réinitialiser la clé"; $t['Reset password'] = "Réinitialiser le mot de passe"; $t['Reset to Default'] = "Réinitialiser par défaut"; $t['Right'] = "Droite"; $t['Rotate LEFT'] = "Tourne à gauche"; $t['Rotate RIGHT'] = "Tourner à droite"; $t['SMTP Host'] = "Hôte SMTP"; $t['SMTP Password'] = "Mot de passe SMTP"; $t['SMTP Port'] = "Port SMTP"; $t['SMTP Secure'] = "SMTP sécurisé"; $t['SMTP Username'] = "Nom d'utilisateur SMTP"; $t['Save'] = "Enregistrer"; $t['Save Stream'] = "Enregistrer Stream"; $t['Save changes'] = "Enregistrer les modifications"; $t['Save File'] = "Enregistrer le fichier"; $t['Script Code'] = "Code personnalisé"; -$t['Search'] = "Rechercher..."; +$t['Search'] = "Rechercher …"; $t['Select a file to submit!'] = "Sélectionner un fichier à envoyer !"; $t['Select a language!'] = "Selectionner un language!"; $t['Select an icon for the category'] = "Sélectionner une icône pour la catégorie"; $t['Select an icon for the menu'] = "Sélectionner une icône pour ce menu"; $t['Select the update'] = "Sélectionner la mise à jour"; $t['Send'] = "Envoyer"; $t['Server URL'] = "URL du serveur"; $t['Session Timeout in seconds'] = "Timeout de session en secondes"; $t['Share'] = "Partager"; $t['Share Info'] = "Partager l'info"; $t['Share Video'] = "Partager la vidéo"; $t['Show _MENU_ entries'] = "Afficher les _MENU_ entrées"; $t['Showing 0 to 0 of 0 entries'] = "Affichage 0 sur 0 pour 0 enregistrement(s)"; $t['Showing _START_ to _END_ of _TOTAL_ entries'] = "Affichage de _START_ sur _END_ pour _TOTAL_ enregistrement(s)"; $t['Showing {{ctx.start}} to {{ctx.end}} of {{ctx.total}} entries'] = "Affichage de {{ctx.start}} sur {{ctx.end}} pour {{ctx.total}} enregistrement(s)"; $t['Sign In'] = "Se connecter"; $t['Sign Out'] = "Se déconnecter"; $t['Sign Up'] = "S'inscrire"; $t['Sign Up Disabled'] = "Inscription Désactivée"; $t['Sign in'] = "Se connecter"; $t['Sign in now!'] = "inscris-toi vite !"; $t['Sign in to add this video to a playlist.'] = "Connecte-toi pour ajouter cette vidéo à une playlist."; $t['Sign in to subscribe to this channel'] = "Connecte-toi pour t'abonner à cette chaîne"; $t['Sign out'] = "Se déconnecter"; $t['Sign up'] = "S'inscrire"; $t['Site Configurations'] = "Paramètres"; $t['Skip Ad'] = "Passer la pub"; $t['Skip Button appears after (X) seconds'] = "Le bouton Ignorer apparaît après (X) secondes"; $t['Sorry!'] = "Désolé !"; $t['Sorry you not able to download videos right now!'] = "Désolé, Vous ne pouvez pas télécharger de vidéos pour le moment. Contacte-nous afin d'en faire la demande 😄"; $t['Sorry'] = "Désolé"; $t['Sort by name'] = "Trier par nom"; $t['Source'] = "Source"; $t['Spanish'] = "Espanol"; $t['Starts on'] = "Commence le"; $t['Status'] = "Statut"; $t['Status not found'] = "Statut non trouvé"; $t['Stop ad after (X) clicks'] = "Arrêter l'annonce après (X) clics"; $t['Stop ad after (X) prints'] = "Arrêter l'annonce après (X) impressions"; $t['Stream name/key'] = "Nom du flux"; $t['Stream Settings'] = "Paramètres du flux"; $t['Style & Themes'] = "Style et thèmes"; $t['Subscribe'] = "S'abonner"; $t['Subscribed'] = "Abonné"; $t['Subscribed to'] = "Abonnés :"; $t['Subscribes'] = "Abonne"; $t['Subscriptions'] = "Abonnements"; $t['Subtitle Form'] = "Formulaire de sous-titre"; $t['Success'] = "Succès"; $t['Success!'] = "Succès !"; $t['Suggest'] = "Suggérer"; $t['Unsuggest'] = "Ne plus suggérer"; $t['Support value can not be empty'] = "Cette valeur ne peut pas être vide"; $t['Supported'] = "Supporté"; $t['Tags'] = "Mots clés"; $t['Test Email'] = "Tester e-mail"; $t['Test your email'] = "Tester mon e-mail"; $t['Thank you'] = "Merci"; $t['The captcha is empty'] = "Le captcha est vide"; $t['The captcha is wrong'] = "Le captcha est faux"; $t['The file must be an .vtt file!'] = "Le fichier doit se terminer par .vtt !"; $t['The original file for this video does not exists anymore'] = "Le fichier original de cette vidéo n'existe plus"; $t['The recover pass does not match!'] = "Le passe de récupération ne correspond pas !"; $t['Theme for Style:'] = "Theme for Style:"; $t['Themes'] = "Thèmes"; $t['There is missing data to recover your password'] = "Il manque des information pour récupérer ton mot de passe"; $t['There is no streaming now'] = "Il n'y a pas de diffusion actuellement"; $t['This creates a download-button under your video, suggest you title.mp4 as download-name.'] = "Ceci permet de créer un bouton de téléchargement sous la vidéo."; $t['Email Configuration'] = 'Configuration e-mail'; $t['This e-mail will be used for this web site notifications'] = "Cet e-mail sera utilisé pour les notifications de ce site Web"; $t['This help us to track and dettect errors'] = "Cela nous aide à suivre et à détecter les erreurs"; $t['This is an experimental resource'] = "Ceci est une ressource expérimentale"; $t['This page works only with a MP4 File, if you have or need any other format, try to install your own encoder or use the public one'] = "This page works only with a MP4 File, if you have or need any other format, try to install your own encoder or use the public one"; $t['This plugin is not available for you'] = "This plugin is not available for you"; $t['This value must match with the language files on'] = "Cette valeur doit correspondre aux fichiers de langue sur"; $t['This video will cost you %s point(s)'] = "Cette vidéo vous coûtera %s point(s)"; $t['This video will work as an advertising and will no longer appear on videos list'] = "Cette vidéo fonctionnera comme une publicité et n'apparaîtra plus sur la liste des vidéos"; $t['Thumbs Down'] = "Pouces vers le bas"; $t['Thumbs Up'] = "Pouces vers le haut"; $t['Timeline'] = "Chronologie"; $t['Title'] = "Titre"; $t['To'] = "À"; $t['To install it right away for all UNIX users (Linux, OS X, etc.), type: '] = "Pour l'installer immédiatement pour tous les utilisateurs UNIX (Linux, OS X, etc.), tapez:"; $t['To installations instructions try this link: '] = "Pour les instructions d'installation, essayez ce lien:"; $t['To view this video please enable JavaScript, and consider upgrading to a web browser that'] = "Pour voir cette vidéo, veuillez activer JavaScript et envisager de passer à un navigateur Web"; $t['Today Views'] = "Vues aujourd'hui"; $t['Total Duration Videos (Minutes)'] = "Durée totale en minutes"; $t['Total Subscriptions'] = "Total des abonnements"; $t['Total Users'] = "Nombre total d'utilisateurs"; $t['Total Video Comments'] = "Total des commentaires"; $t['Total Videos'] = "Nombre total de vidéos"; $t['Total Videos Dislikes'] = "Nombre de vidéos non-aimées"; $t['Total Videos Likes'] = "Nombre de vidéos aimées"; $t['Total Videos Views'] = "Total des vues"; $t['Total Views'] = "Vues totales"; $t['Total Views (90 Days)'] = "Vues totales (90 jours)"; $t['Total Views Today'] = "Total des vues aujourd'hui"; $t['Translated Array'] = "Matrice traduite"; -$t['Trying to establish a chat server connection'] = "Connexion au serveur chat..."; +$t['Trying to establish a chat server connection'] = "Connexion au serveur chat …"; $t['Type'] = "Type"; $t['Type the code'] = "Entrez le code"; -$t['Type your message...'] = "Tape ton message..."; +$t['Type your message...'] = "Entrez votre message …"; $t['URL'] = "URL"; $t['Unable to open file!'] = "Impossible d'ouvrir le fichier !"; $t['Uncheck all to make it public'] = "Tout décocher pour le rendre public"; $t['Unique Users'] = "Utilisateurs uniques"; $t['Unknown User'] = "Utilisateur inconnu"; $t['Up'] = "Haut"; $t['Up Next'] = "Suivant"; $t['Update Now'] = "Mettre à jour maintenant"; $t['Update AVideo System'] = "Mettre à jour AVideo"; $t['Update the site configuration'] = "Mettre à jour la configuration du site"; $t['Update version'] = "Mettre à jour"; $t['Update your user'] = "Mettez à jour votre utilisateur"; $t['Upload a Background'] = "Télécharger un arrière-plan"; $t['Upload a MP4 File'] = "Télécharger un fichier MP4"; $t['Upload a MP4 video'] = "Importer une vidéo MP4"; $t['Upload a Photo'] = "Importer la photo"; $t['Upload a Plugin'] = "Télécharger un plugin"; $t['Upload a Plugin ZIP File'] = "Télécharger un fichier ZIP de plug-in"; $t['Upload a logo'] = "Télécharger un logo"; $t['Upload a small logo'] = "Envoyer un petit logo"; $t['Upload to YouTube'] = "Envoyer sur YouTube"; $t['Upload your file'] = "Envoyer un fichier"; $t['Uploaded By'] = "Envoyé par"; $t['Use one of the recommended resolutions'] = "Utilisez l'une des résolutions recommandées"; $t['Use tls OR ssl'] = "Utilisez tls OU ssl"; $t['User'] = "Utilisateur"; $t['User Form'] = "Formulaire d'utilisateur"; $t['User Groups'] = "Groupes d'utilisateurs"; $t['User Groups Form'] = "Formulaire Groupes d'utilisateurs"; $t['User already exists'] = "L'utilisateur existe déjà"; $t['User and Password can not be blank'] = "L'utilisateur et le mot de passe ne peuvent pas être vides"; $t['User can not be blank'] = "L'utilisateur ne peut pas être vide"; $t['User not found'] = "Utilisateur non trouvé"; $t['UserGroups'] = "Groupes d'utilisateurs"; $t['Users'] = "Utilisateurs"; $t['Users Groups'] = "Groupes d'utilisateurs"; $t['Verification Sent'] = "Verification envoyée"; $t['Verify e-mail'] = "Verifier l'e-mail"; $t['Video'] = "Vidéo"; $t['Video Advertising'] = "Publicité vidéo"; $t['Video and Audio Upload'] = "Téléchargement vidéo et audio"; $t['Video Chart'] = "Statistiques vidéo"; $t['Video Form'] = "Formulaire vidéo"; $t['Video Link'] = "Lien vidéo"; $t['Video Title'] = "Titre de la vidéo"; $t['Video URL'] = "URL de la vidéo"; $t['Video can not be empty'] = "La vidéo ne peut pas être vide"; $t['Video not found'] = "Vidéo non trouvée"; $t['Video re-encoding!'] = "Ré-encodage vidéo !"; $t['Video thumbs up - per Channel'] = "Appréciations des vidéos - Par chaîne"; $t['Video views - per Channel'] = "Nombre de vues - Par chaîne"; $t['Video Resolution'] = "Résolution vidéo"; $t['Videos'] = "Vidéos"; $t['Videos linked'] = "Vidéos liées"; $t['View'] = "vue"; $t['View Details'] = "Voir les détails"; $t['View all replies'] = "Voir toutes les réponses"; $t['Views'] = "Vues"; $t['Want to subscribe to this channel?'] = "Tu veux t'abonner à cette chaîne ?"; $t['Want to watch this again later?'] = "Tu veux regarder ça plus tard ?"; $t['Warning'] = "Attention"; $t['Watch on YouTube'] = "Regarder sur YouTube"; $t['Watching Now'] = "Regarder maintenant"; $t['week'] = "semaine"; $t['weeks'] = "semaines"; $t['We detected a total of %s pending updates, if you want to do it now click (Update Now) button'] = "Nous avons détecté un total de %s mises à jour en attente, si vous voulez le faire maintenant, cliquez sur le bouton (Mettre à jour maintenant)"; $t['We have not found any videos or audios to show'] = "Nous n'avons trouvé aucune vidéo ou audios à afficher"; $t['We sent you an e-mail with instructions'] = "Nous t'avons envoyé un e-mail avec des instructions 😌"; $t['We use youtube-dl to download videos from youtube.com or other video platforms'] = "Nous utilisons youtube-dl pour télécharger des vidéos sur youtube.com ou d'autres plateformes vidéo"; $t['We will send you a link, to your e-mail, to recover your password!'] = "Nous t'enverrons un lien sur ton adresse e-mail pour récupérer ton mot de passe ! 👮"; $t['We would like to thanks http://bootswatch.com/'] = "Nous aimerions remercier Bootswatch (http://bootswatch.com/) pour les thèmes proposés."; $t['Web site title'] = "Titre du site Web"; $t['WebCam Streaming'] = "Diffusion via webcam"; $t['Website'] = "Site Internet"; $t['Welcome %s, update your informations'] = "Bienvenue %s, mets à jours tes informations"; $t['What is User Groups'] = "Qu'est-ce que les groupes d'utilisateurs ?"; $t['This is where you can create groups and associate them with your videos and users. This will make your videos private. Only users who are in the same group as the videos can view them'] = 'C\'est ici que vous pouvez créer des groupes et les associer à vos vidéos et utilisateurs. Cela rendra vos vidéos privées. Seuls les utilisateurs appartenant au même groupe que les vidéos peuvent les visionner.'; $t['What is the new name?'] = "Quel est le nouveau nom ?"; $t['What is this'] = "Qu'est-ce que c'est"; $t['When'] = "Quand"; $t['When autoplay is enabled, a suggested video will automatically play next.'] = "Lorsque la lecture automatique est activée, une vidéo suggérée est jouée automatiquement."; $t['Word Translations'] = "Traductions de mots"; $t['Yes'] = "Oui"; -$t['Yes, delete it!'] = "Oui allez, supprime moi ça !"; +$t['Yes, delete it!'] = "Oui allez, supprimez-moi ça !"; $t['You%20can%20not%20manage'] = "Tu%20ne%20peux%20pas%20gérer"; $t['AVideo URL'] = "AVideo URL"; $t['You already support this video'] = "Vous soutenez déjà cette vidéo"; $t['You are hosting %d minutes and %d seconds of video'] = "Vous hébergez actuellement %d minutes et %d secondes de vidéo 💪"; $t['You are not allowed see this streaming'] = "Tu n'es pas autorisé à voir cette diffusion"; $t['You are not logged'] = "Tu n'es pas connecté"; -$t['You are not online, loading webcam...'] = "Tu n'es pas en ligne, chargement de la webcam..."; -$t['You are online now, web cam is disabled'] = "Tu es maintenant en ligne, webcam désactivée"; +$t['You are not online, loading webcam...'] = "Vous n'êtes pas en ligne, chargement de la WebCam …"; +$t['You are online now, web cam is disabled'] = "Vous êtes maintenant en ligne, WebCam désactivée"; $t['You are running AVideo version %s!'] = "Vous utilisez AVideo version %s !"; $t['You asked for a recover link, click on the provided link'] = "Vous avez demandé un lien de récupération, clique dessus 👍"; $t['You can not Manage This Video'] = "Vous ne pouvez pas gérer cette vidéo"; $t['You can not do this'] = "Vous ne pouvez pas faire ça"; $t['You can not manage ads'] = "Vous ne pouvez pas gérer les annonces"; $t['You can not manage categories'] = "Vous ne pouvez pas gérer les catégories"; $t['You can not manage comments'] = "Vous ne pouvez pas gérer les commentaires"; $t['You can not manage plugins'] = "Vous ne pouvez pas gérer les plugins"; $t['You can not manage subscribes'] = "Vous ne pouvez pas gérer les abonnements"; $t['You can not manage users'] = "Vous ne pouvez pas gérer les utilisateurs"; $t['You can not manage videos'] = "Vous ne pouvez pas gérer gérer les vidéos"; $t['You can not manager payouts'] = "Vous ne pouvez pas gérer les paiements"; $t['You can not manager plugin PointsSystem'] = "Vous ne pouvez pas gérer ce plugin"; $t['You can not manager plugin add logo'] = "Vous ne pouvez pas gérer ce plugin"; $t['You can not manager plugin customize'] = "Vous ne pouvez pas gérer ce plugin"; $t['You can not manager plugin logo overlay'] = "Vous ne pouvez pas gérer ce plugin"; $t['You can not manager plugin this'] = "Vous ne pouvez pas gérer ce plugin"; $t['You can not manager plugins'] = "Vous ne pouvez pas gérer les plugins"; $t['You can not manager wallets'] = "Vous ne pouvez pas gérer les portes-monnaies"; $t['You can not notify'] = "Vous ne pouvez pas envoyer de notification"; $t['You can not see history'] = "Vous ne pouvez pas voir l'historique"; $t['You can not stream live videos'] = "Vous ne pouvez pas diffuser de vidéos en direct"; $t['You can storage %s minutes of videos!'] = "Vous pouvez stocker %s minutes de vidéos !"; $t['You can upload max of %s!'] = "Vous pouvez télécharger max de %s !"; $t['You can use our public encoder on'] = "Il est possible d'utiliser l'encodeur public sur"; $t['or'] = 'ou'; $t['You cannot comment on videos'] = "🔏"; $t['You could not use your balance to watch this video'] = "Vous ne pouvez pas utiliser votre balance pour regarder cette vidéo"; $t['You do not have an e-mail'] = "Vous n'avez pas d'e-mail"; $t['You don\'t have balance'] = "Vous n'avez pas assez de crédits."; $t['You have %s minutes of videos!'] = "Vous avez %s minutes de vidéos !"; $t['You have about %s minutes left of video storage!'] = "Il te reste environ %s minutes de stockage vidéo !"; $t['You have sent the notification'] = "Vous avez envoyé la notification"; $t['You have version '] = "Vous avez la version "; $t['You must be logged'] = "Vous devez être connecté 🙃"; $t['You must fill all fields'] = "Vous devez remplir tous les champs"; $t['You must login to be able to comment on videos'] = "Connecte-toi pour commenter !"; $t['You must make this video public or select a group to see your video!'] = "Vous devez rendre cette vidéo publique ou sélectionner un groupe qui pourra la visionner !"; $t['You need a user and passsword to register'] = "Vous avez besoin d'un nom d'tilisateur et d'un mot de passe pour t'enregistrer"; $t['You need a video to generate statistics'] = "Vous avez besoin d'une vidéo pour générer des statistiques"; $t['You need to inform what is your user!'] = "Veuillez entrer votre nom d'utilisateur avant d'utiliser cette fonction."; $t['You need to install'] = "Vous devez installer"; $t['You need to make your locale folder writable'] = "Vous devez rendre votre dossier de paramètres régionaux accessible en écriture"; $t['You need to set up an encoder server'] = "Le serveur d'encodage est nécessaire."; $t['You need to tell us the new name?'] = "Vous devez nous dire le nouveau nom ?"; $t['You will not be able to recover these videos!'] = "Tu ne ne pourra pas récupérer ces vidéos !"; $t['You will not be able to recover this action!'] = "Tu ne sera pas capable de revenir en arrière !"; $t['You will not be able to recover this category!'] = "Tu ne sera pas en mesure de récupérer cette catégorie !"; $t['You will not be able to recover this group!'] = "Tu ne sera pas en mesure de récupérer ce groupe !"; $t['You will not be able to recover this user!'] = "Tu ne sera pas capable de récupérer cet utilisateur !"; $t['You will not be able to recover this video!'] = "Tu ne sera pas en mesure de récupérer cette vidéo !"; $t['You will not be able to recover this!'] = "Tu ne sera pas en mesure de récupérer ceci !"; $t['You will request a payout of '] = "Vous avez demandé un paiement de "; $t['You will support this video with '] = "Tu soutien cette vidéo avec "; $t['Your %slocale dir is not writable'] = "Ton répertoire %slocale n'est pas accessible en écriture"; $t['Your Logo'] = "Votre logo"; $t['Your POST data is empty may be your vide file is too big for the host'] = "Tes données POST sont vides peut-être que ton fichier vidéo est trop grand pour l'hôte"; $t['Your Password has been set'] = "Ton mot de passe a été défini"; $t['Your Payout request was saved!'] = "Ta demande de paiement a été enregistrée !"; $t['Your Small Logo'] = "Ton petit logo"; $t['Your ad has NOT been deleted!'] = "L'annonce n'a PAS été supprimée !"; $t['Your ad has NOT been saved!'] = "L'annonce n'a PAS été enregistrée !"; $t['Your ad has been deleted!'] = "L'annonce a été supprimée"; $t['Your ad has been saved!'] = "L'annonce a été enregistrée !"; $t['Your balance has NOT been saved!'] = "Ton argent n'a pas été enregistré !"; $t['Your cache has been cleared!'] = "Le cache a été vidé"; $t['Your cache has NOT been cleared!'] = "Le cache n'a PAS été vidé"; $t['Your category has been deleted!'] = "Ta catégorie a été supprimée !"; $t['Your category has been saved!'] = "Ta catégorie a été enregistrée !"; $t['Your category has NOT been deleted!'] = "Ta catégorie n'a PAS été supprimée !"; $t['Your category has NOT been saved!'] = "Ta catégorie n'a PAS été enregistrée !"; $t['Your code is not valid'] = "Ton code n'est pas valide"; $t['Your comment has NOT been deleted!'] = "Ton commentaire n'a PAS été supprimé !"; $t['Your comment has been saved!'] = "Ton commentaire a été sauvegardé !"; $t['Your comment has NOT been saved!'] = "Ton commentaire n'a PAS été enregistré !"; $t['Your comment must be bigger then 5 characters!'] = "Ton commentaire doit être plus grand que 5 caractères !"; $t['Your configurations has been updated!'] = "Tes configurations ont été mises à jour !"; $t['Your configurations has NOT been updated!'] = "Tes configurations n'ont PAS été mises à jour !"; $t['Your cost has NOT been saved!'] = "Le prix n'a PAS été enregistré !"; $t['Your current balance is %s'] = "Ton porte monnaie est de %s"; $t['Your encode video resolution is set to %s !'] = "Ton encodage de la résolution vidéo est réglé sur %s !"; $t['Your group has NOT been deleted!'] = "Ton groupe n'a pas été supprimé !"; $t['Your group has NOT been saved!'] = "Ton groupe n'a PAS été enregistré !"; $t['Your group has been deleted!'] = "Ton groupe a été supprimé !"; $t['Your group has been saved!'] = "Ton groupe a été enregistré !"; $t['Your language has been saved!'] = "Ta langue a été enregistrée !"; $t['Your maximum file size is:'] = "la taille maximale de ton fichier est :"; $t['Your message could not be sent!'] = "Désolé, le message n'a pas pu être envoyé."; $t['Your message has been sent!'] = "Le message a été envoyé !"; $t['Your new password could not be set!'] = "Ton nouveau mot de passe n'a pas pu être défini !"; $t['Your new password has been set!'] = "Ton nouveau mot de passe a été défini !"; $t['Your password does not match!'] = "Ton mot de passe ne correspond pas !"; $t['Your payout status has NOT been saved!'] = "Le statut de ton paiement n'est pas enregistré !"; $t['Your subtitle has NOT been uploaded!'] = "Tes sous-titres non PAS été envoyés"; $t['Your subtitle has been saved!'] = "Tes sous-titres son sauvegardé"; $t['Your system is up to date'] = "Le système AVideo est à jour"; $t['Your update from file %s is done, click continue'] = "La mise à jour de ton fichier %s est terminée, clique sur continuer"; $t['Your user has been deleted!'] = "Ton utilisateur a été supprimé !"; $t['Your user has been saved!'] = "Tob utilisateur a été enregistré !"; $t['Your user has been updated!'] = "Tob utilisateur a été mis à jour !"; $t['Your user has NOT been created!'] = "Ton utilisateur n'a pas été créé !"; $t['Your user has NOT been deleted!'] = "Ton utilisateur n'a PAS été supprimé !"; $t['Your user has NOT been saved!'] = "Ton utilisateur n'a PAS été enregistré !"; $t['Your user has NOT been updated!'] = "Ton utilisateur n'a PAS été mis à jour !"; $t['Your user or password is wrong!'] = "Ton utilisateur ou votre mot de passe est faux !"; $t['Your video has been deleted!'] = "Ta vidéo a été supprimée !"; $t['Your video has been saved!'] = "Ta vidéo a été enregistrée !"; $t['Your video has NOT been deleted!'] = "Ta vidéo n'a PAS été supprimée !"; $t['Your video has NOT been saved!'] = "Ta vidéo n'a PAS été enregistrée !"; $t['Your video %s was uploaded to your YouTube Account
'] = "Ta vidéo % s a été importé dans ton Compte YouTube
"; $t['Your video download is complete, it is encoding now'] = "Ton téléchargement de vidéo est terminé, il est en cours d'encodage à présent"; $t['Your video has NOT been deleted!'] = "Ta vidéo n'a PAS été supprimée !"; $t['Your video has NOT been saved!'] = "Ta vidéo n'a pas été enregistrée !"; $t['Your video is downloading now'] = "Ta vidéo est en cours de téléchargement"; $t['Your videos have NOT been deleted!'] = "Tes vidéos n'ont PAS été supprimées !"; $t['Youtube'] = "Youtube"; $t['ago'] = "depuis"; $t['day'] = "jour"; $t['days'] = "jours"; $t['description'] = "description"; $t['hour'] = "heure"; $t['hours'] = "heures"; $t['is Active'] = "Actif"; $t['is Admin'] = "Administrateur"; $t['minute'] = "minute"; $t['minutes'] = "minutes"; $t['month'] = "mois"; $t['months'] = "mois"; $t['remaining'] = "restant"; $t['second'] = "seconde"; $t['seconds'] = "secondes"; $t['week'] = "semaine"; $t['weeks'] = "semaines"; $t['year'] = "année"; $t['years'] = "années"; $t['youtube-dl uses Python and some servers does not came with python as dafault, to install Python type:'] = "youtube-dl utilise Python et certains serveurs ne sont pas livrés avec python. Pour installer Python:"; $t['installed , but your database is not up to date. This could lead to bugs. Please go to the update-site.'] = "Installé, mais la base de données n'est pas à jour. Cela pourrait conduire à des bugs. Mettez à jour depuis votre panel."; $t['Sorry, this video is private'] = "Désolé, cette vidéo est privée et donc en accès restreint."; $t['Home'] = "Accueil"; $t['Trending'] = "Tendances"; $t['Suggested'] = "Suggérées"; $t['My Menu'] = "Menu personnel"; $t['Main Menu'] = "Menu principal"; $t['Analytics Code'] = "Code Google Analytics"; $t['Track your videos with Google analytics'] = "Pistez vos vidéos avec Google Analytics"; $t['My Subscribers'] = "Mes abonnés"; $t['Menu Admin'] = "Menu d'administration"; $t['Admin Panel'] = "Administration"; $t['Clear First Page Cache'] = "Nettoyer le cache Première Page"; $t['Your First Page cache has been cleared!'] = "Le cache Première Page a été nettoyé !"; $t['Log file'] = "Fichier journal"; $t['Generate Sitemap'] = 'Générer le Sitemap'; $t['Size'] = 'Taille'; $t['Free'] = 'Gratuit'; $t['Upload Form'] = 'Formulaire d\'envoi'; $t['Password Protected'] = 'Restriction par mot de passe'; $t['Only Paid Users Can see'] = 'Restreindre aux utilisateurs payants'; $t['Public Media'] = 'Média public'; $t['Users linked'] = 'utilisateur(s) lié(s)'; $t['Media Owner'] = 'Propriétaire'; $t['Meta Data'] = 'Métadonnées'; $t['Paid Content'] = 'Payant'; $t['Unlisted'] = 'Invisible'; $t['Basic Info'] = 'Informations principales'; $t['Profile Photo'] = 'Photo de profil'; $t['You must click save to confirm'] = 'Vous devez cliquer sur Enregistrer pour confirmer le changement.'; $t['Make sure you click on the Save button after change the photo'] = 'Assurez-vous de cliquer sur le bouton Enregistrer situé ci-dessous après avoir changé de photo.'; $t['Channel Art'] = 'Bannière de chaîne'; $t['For the best results, please Use this image as a guide to create your Channel Art'] = "Pour de meilleurs résultats, veuillez utiliser l'image ci-dessous comme guide pour créer votre illustration de chaîne."; $t['minImageWidth'] = "Largeur minimale de l'image "; $t['maxImageWidth'] = "Largeur maximale de l'image "; $t['minImageHeight'] = "Hauteur minimale de l'image "; $t['maxImageHeight'] = "Hauteur maximale de l'image "; $t['Active Users'] = 'Utilisateurs actifs'; $t['Inactive Users'] = 'Utilisateurs inactifs'; // Utilisateur $t['Info'] = 'Informations'; $t['User Info'] = 'Information Utilisateur'; $t['First Name'] = 'Prénom'; $t['Last Name'] = 'Nom'; $t['Address'] = 'Addresse'; $t['Zip Code'] = 'Code postal'; $t['Country'] = 'Pays'; $t['Region'] = 'Région'; $t['City'] = 'Ville'; $t['Document'] = 'Document'; $t['Admin'] = 'Administrateur'; $t['Do not paste the full javascript code, paste only the gtag id'] = 'Ne copiez pas le code JavaScript en entier, copiez uniquement le Gtag ID'; $t['Google Analytics Code: UA-123456789-1'] = 'Code Google Analytics : UA-123456789-1'; // Groupe $t['Group Permissions'] = 'Privilèges de groupe'; $t['Comments Admin'] = 'Administration des commentaires'; $t['Users with this option will be able to edit and delete comments in any video'] = 'Les utilisateurs avec ce privilège peuvent modifier ou supprimer les commentaires de n\'importe quelle vidéos'; $t['Videos Admin'] = 'Administration des vidéos'; $t['Just like admin, this user will have permission to edit and delete videos from any user, including videos from admin'] = 'Ce privilège donne le pouvoir de modifier ou supprimer les vidéos de n\'importe quel utilisateur, incluant les vidéos des adminstrateurs'; $t['Videos Moderator'] = 'Modération des vidéos'; $t['This is a level below the (Videos Admin), this type of user can change the video publicity (Active, Inactive, Unlisted)'] = 'Ce type d\'utilisateur peut modifier le niveau de confidentialité des vidéos'; $t['Users Admin'] = 'Administration des utilisateurs'; $t['This type of user can edit users, can add or remove users into user groups, but cannot make them admins'] = 'Ce pouvoir donne la possibilité de modifier les utilisateurs, d\'ajouter ou supprimer des utilisateurs des groupes, mais ne permet pas de rendre des utilisateurs administrateurs'; $t['Users Groups Admin'] = 'Administration des groupes d\'utilisateurs'; $t['Can edit and delete user groups'] = 'Donne le pouvoir de modifier ou supprimer des groupes d\'utilisateurs'; $t['Cache Manager'] = 'Gestionnaire du cache'; $t['This will give the option to can clear cache (Site and first page)'] = 'Cette option donne le pouvoir à l\'utilisateur de supprimer les caches internes du serveur'; $t['Sitemap'] = 'Sitemap'; $t['This will give the option to generate SiteMap'] = 'Cette option donne le pouvoir de générer Sitemap'; $t['Log'] = 'Journal'; $t['This will give the option to see the log file menu'] = 'Cette option donne le pouvoir de voir les journaux système'; $t['Add User Group'] = 'Ajouter un groupe d\'utilisateur'; $t['Remove User Group'] = 'Supprimer un groupe d\'utilisateur'; $t['Owner'] = 'Propriétaire'; $t['Resolution'] = 'Résolution'; $t['Encoder'] = 'Encodeur'; $t['Video Duration'] = 'Durée'; $t['Video Views'] = 'Vues'; $t['Suggested Video'] = 'Suggérées'; $t['Next video NOT set'] = 'Vidéo suivante indéfinie'; $t['Swap Video File'] = 'Échanger fichiers vidéo'; $t['You MUST select 2 videos to swap'] = 'Vous devez sélectionner deux vidéos à échanger.'; $t['Update all videos disk usage'] = 'Mettre à jour l\'utilisation du disque dur pour toutes les vidéos'; $t['Update Disk Usage'] = 'Mettre à jour les propriétés'; $t['Update disk usage for this media'] = 'Mettre à jour l\'utilisation du disque dur pour ce média'; $t['Remove Thumbs'] = 'Supprimer les miniatures'; $t['Remove thumbs for this media'] = 'Supprimer les miniatures pour ce média'; $t['Videos Directory'] = 'Fichiers média '; $t['Other Files'] = 'Autres fichiers '; $t['Free Space'] = 'Espace libre '; $t['Copy embed code'] = 'Copier le code d\'intégration'; $t['Copied'] = 'Copié'; $t['This video is Active and Listed, click here to unlist it'] = 'Cette vidéo est activée et visible, cliquez ici pour la rendre invisible'; $t['This video is unlisted, click here to inactivate it'] = 'Cette vidéo est invisible, cliquez ici pour la rendre visible'; +$t['Not Rated'] = 'Pas de classification'; +$t['Not Rated (NR)'] = 'Pas de classification'; $t['R Rating'] = 'Classification R'; -$t['Not Rated'] = 'Not Rated (NR)'; $t['Embed code for trailer'] = 'Code d\'intégration pour le trailer'; $t['Start video at'] = 'Démarrer la vidéo à la position '; + $t['Poster (JPG)'] = 'Poster (JPG)'; $t['Portrait Poster (JPG)'] = 'Poster portrait (JPG)'; $t['Mouse Over Poster (WebP)'] = 'Souris au-dessus du poster (WebP)'; $t['Mouse Over Poster (GIF)'] = 'Souris au-dessus du poster (GIF)'; $t['Mouse Over Portrait Poster (GIF)'] = 'Souris au-dessus du portrait poster (GIF)'; $t['Settings'] = 'Paramètres'; $t['Contents'] = 'Contenu'; $t['Design'] = 'Apparence'; $t['Miscellaneous'] = 'Divers'; $t['Remove Branding'] = 'Paramètres d\'identité visuelle'; $t['Title and Logo'] = 'Titre du site et logo'; $t['Customize Footer, About and Meta Description'] = 'Personnaliser le pied de page, la page A propos et la meta-description'; $t['Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.'] = 'Personnalisez vraiment votre instance AVideo et créez une plateforme vidéo plus professionnelle pour vos visiteurs en supprimant ou en remplaçant le pied de page, la page A propos, les meta-descriptions par les vôtres mais aussi en personnalisant les couleurs de votre thème.'; $t['Buy the Customize plugin now'] = 'Acheter le plugin Customize maintenant'; $t['General Settings'] = 'Paramètres principaux'; $t['Upload'] = 'Téléversement'; $t['Sign In/Up'] = 'Connexion et enregistrement'; $t['Site Settings'] = 'Paramètres du site'; $t['Authenticated users can view chart'] = 'Les utilisateurs authentifiés peuvent voir les statistiques'; $t['For uploaders'] = 'Pour les téléverseurs'; $t['For selected, admin view'] = 'Pour les utilisateurs sélectionnés'; $t['Basic'] = 'Principal'; $t['Logo and Title'] = 'Logo et titre du site'; $t['Choose a logo'] = 'Téléverser un logo'; $t['Choose a favicon'] = 'Téléverser un Favicon'; $t['Allow download video'] = 'Autoriser le téléchargement de vidéos'; $t['is Present'] = 'est présent'; $t['Your videos directory is writable'] = 'Votre répertoire de vidéos est accessible en écriture'; $t['Email All Users'] = 'Envoyer un e-mail en masse'; $t['Live Stuff'] = 'Diffusion en direct'; $t['CSV File'] = 'Exporter en CSV'; $t['Loop'] = 'Répéter'; $t['Copy video URL'] = 'Copier l\'URL de la vidéo'; $t['Copy video URL at current time'] = 'Copier l\'URL de la vidéo à la position courante'; $t['Social Login Settings'] = 'Paramètres Social Login'; $t['S3, B2, FTP settings'] = 'Paramètres S3, B2 et FTP'; $t['Payments Settings'] = 'Paramètres de paiement'; // Backup $t['Backup'] = 'Sauvegarde'; $t['Backup Files and Database'] = 'Sauvegarde des fichiers et de la base de données'; $t['Prevent Data Loss'] = 'Empêcher la perte de données'; $t['Backing up your video files and databases, running test restores procedures on your backups, and storing copies of backups in a safe, off-site location protects you from potentially catastrophic data loss. Backing up is the only way to protect your data.'] = 'La sauvegarde de vos fichiers vidéos et de vos bases de données, le test de restauration de vos sauvegardes et le stockage de ces copies de sauvegardes dans un emplacement sûr vous protège contre une perte de données potentiellement catastrophique. La sauvegarde est le seul moyen de protéger vos données.'; $t['We can help you with this task,'] = 'Nous pouvons vous aider pour cette tâche, '; $t['Buy our Backup Plugin Now'] = 'Acheter notre plugin Backup maintenant'; $t['Clone Site'] = 'Cloner le site'; $t['This Plugin helps you to clone your video site, it is really helpful for backup routines, load balance, etc.'] = 'Ce plugin aide à cloner le site. Ceci est utile pour faire des sauvegardes voire créer plusieurs instances identiques pour mettre en place la répartition de charge (Load Balancing).'; $t['Place here the URL of the site you want to clone'] = 'Indiquez ici l\'URL du site que vous souhaitez cloner.'; $t['Clones Manager'] = 'Gestionnaire de clones'; $t['Clone Now'] = 'Cloner maintenant'; $t['You May find some help how to use Clone Plugin'] = 'Pour obtenir de l\'aide sur ce plugin, cliquez'; $t['here'] = 'ici'; $t['First Page Style'] = 'Style Première Page'; $t['Player Skin'] = 'Apparence du lecteur'; $t['Colors'] = 'Couleurs'; $t['Customize Your site colors'] = 'Personnaliser les couleurs'; $t['Live Chat'] = 'Chat en direct'; $t['Live Users'] = 'Utilisateurs en direct'; $t['Live Links'] = 'Lien en direct'; $t['Sorry you do not have the plugin'] = 'Désolé, vous n\'avez pas ce plugin'; $t['Buy this plugin now'] = 'Acheter ce plugin maintenant'; // Monetize $t['Monetize'] = 'Monétisation'; $t['Site Advertisement with VAST Video ads'] = 'Gestion des publicités vidéos'; $t['Configure your Ads'] = 'Configurer les publicités'; $t['Enable Ads Plugin'] = 'Activer le plugin Ads'; $t['Create Campaign'] = 'Créer une campagne'; $t['End on'] = 'Se termine le '; $t['Max Prints'] = 'Affichage maximum '; $t['New'] = 'Nouveau'; $t['VMAP Link'] = 'Lien VMAP'; $t['Search'] = 'Rechercher'; $t['Edit Campaigns'] = 'Modifier les campagnes'; $t['Loading'] = 'Chargement'; $t['Show'] = 'Afficher'; $t['entries'] = 'enregistrements'; $t['Start'] = 'Début'; $t['End'] = 'Fin'; $t['Prints Left'] = 'Affichages restants'; $t['Previous'] = 'Précédent'; $t['Next'] = 'Suivant'; $t['Pay User per Video View'] = 'Rétribution des utilisateurs'; $t['Monetize User'] = 'Monétisation des utilisateurs'; $t['Wallet'] = 'Porte-feuilles'; $t['Create Subscription Plans'] = 'Créer des formules d\'abonnements'; $t['Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store'] = "Désolé de vous embêter, mais malheureusement, vous n'avez pas ce plugin actuellement. N'hésitez pas à l'acheter sur notre boutique en ligne."; $t['Subscription Configuration'] = 'Configuration des abonnements'; $t['Plugin Store'] = 'Accéder à la boutique en ligne'; $t['Google AD Sense and any other Ads provider are moved to the'] = 'Google AdSense et tous les autres fournisseurs de publicités sont désormais dans le plugin'; $t['ADs plugin'] = 'plugin Ads'; $t['Leave blank for native code'] = 'Laissez blanc pour du code natif'; $t['For Google Analytics code'] = 'Pour le code Google Analytics '; $t['Search Channel'] = 'Rechercher dans la chaîne'; + +$t['Download your videos list'] = 'Télécharger votre liste de médias'; +$t['(SEO .txt file)'] = '(SEO)'; +$t['(Permalink .txt file)'] = '(Permalink)'; + +$t['Let us upload your video to YouTube'] = 'Si vous souhaitez utiliser la fonction de téléversement automatique vers YouTube …'; +$t['How to setup the Youtube-Upload feature'] = 'Voici comment configurer la fonctionnalité YouTube-Upload '; +$t['You need to enable'] = 'Vous devez activer la'; +$t['Google Login'] = 'Connexion Google'; +$t['and get the following information'] = 'et récupérez les informations suivantes'; +$t['Google ID and Key'] = 'Google ID et la clef correspondante'; +$t['Go to your'] = 'Allez dans votre'; +$t['Google Console API Dashboard'] = 'Tableau de bord Google Console API'; +$t['and enable the following API'] = "et activez l'API suivante"; +$t['YouTube Data API'] = "API de données YouTube (YouTube Data API)"; +$t['In authorized credentials allow the following URIs redirection'] = "Dans les autorisations, activez l'URI suivante"; +$t['You can find more help on the following documentation'] = "Vous pouvez trouver plus d'aide dans la documentation suivante"; +$t['YouTube Data API Overview'] = "Aperçu de l'API YouTube Data"; diff --git a/locale/function.php b/locale/function.php index e92e34b95..66217c35a 100644 --- a/locale/function.php +++ b/locale/function.php @@ -1,108 +1,89 @@ getLanguage(); } if (!empty($_GET['lang'])) { $_GET['lang'] = strip_tags($_GET['lang']); $_SESSION['language'] = $_GET['lang']; } @include_once "{$global['systemRootPath']}locale/{$_SESSION['language']}.php"; function __($str, $allowHTML = false) { global $t; if (empty($t[$str])) { if($allowHTML){ return $str; } return str_replace(array("'", '"', "<", '>'), array(''', '"', '<', '>'), $str); } else { if($allowHTML){ return $t[$str]; } return str_replace(array("'", '"', "<", '>'), array(''', '"', '<', '>'), $t[$str]); } } function isRTL() { - /* - Arabic - Aramaic - Azeri - Dhivehi/Maldivian - Hebrew - Kurdish (Sorani) - Persian/Farsi - Urdu - */ - $array = array( - 'JO', // Arabic Jordan - 'PS', // Arabic Palestinian Territory, Occupied - 'SY', // Arabic Syrian Arab Republic - 'IL' // Hebrew - ); - - if (preg_grep("/{$_SESSION['language']}/i", $array)) { - return true; - } - return false; + global $t_isRTL; + return !empty($t_isRTL) && $t_isRTL; } function getAllFlags() { global $global; $dir = "{$global['systemRootPath']}view/css/flag-icon-css-master/flags/4x3"; $flags = array(); if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $flags[] = str_replace(".svg", "", $entry); } } closedir($handle); } sort($flags); return $flags; } function getEnabledLangs() { global $global; $dir = "{$global['systemRootPath']}locale"; $flags = array(); if (empty($global['dont_show_us_flag'])) { $flags[] = 'us'; } if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != ".." && $entry != "index.php" && $entry != "function.php" && $entry != "save.php") { $flags[] = str_replace(".php", "", $entry); } } closedir($handle); } sort($flags); return $flags; } function textToLink($string, $targetBlank = false) { $target = ""; if($targetBlank){ $target = "target=\"_blank\""; } return preg_replace( "~[[:alpha:]]+://[^<>[:space:]'\"]+[[:alnum:]/]~", "\\0", $string ); } function br2nl($html) { $nl = preg_replace(array('##i','##i','##i'), array("\n","\n",""), $html); return $nl; } diff --git a/locale/il.php b/locale/il.php index 919a490e0..e4b340ab8 100644 --- a/locale/il.php +++ b/locale/il.php @@ -1,843 +1,845 @@ encoder or use the public one'] = "דף זה פועל רק עם קבצי MP4, MP3 ו- OGG, אם יש לך או צריך פורמט אחר, נסה להתקין את עצמו או להשתמש ב הציבור "; $t['This value must match with the language files on'] = "ערך זה חייב להתאים לקובצי השפה"; $t['This video was reported to our team, we will review it soon'] = "סרטון זה דווח לצוות שלנו, נבדוק אותו בקרוב"; $t['Thumbs Down'] = "בוז"; $t['Thumbs Up'] = "אגודלים למעלה"; $t['Timeline'] = "ציר זמן"; $t['Timelive'] = "טימליב"; $t['Title'] = "כותרת"; $t['To'] = "ל"; $t['To install it right away for all UNIX users (Linux, OS X, etc.), type: '] = "כדי להתקין את זה מיד לכל משתמשי UNIX (לינוקס, OS X, וכו '), הקלד:"; $t['To installations instructions try this link: '] = "להוראות להתקנה נסה קישור זה:"; $t['To view this video please enable JavaScript, and consider upgrading to a web browser that'] = "כדי להציג סרטון זה, הפעל את JavaScript, ושקול לשדרג לדפדפן אינטרנט זה"; $t['Today'] = "היום"; $t['Today Views'] = "צפיות היום"; $t['Total Amount'] = "הכמות הכוללת"; $t['Total Duration Videos (Minutes)'] = "משך הסרטון הכולל (דקות)"; $t['Total Subscriptions'] = "סה\"כ מנויים"; $t['Total Users'] = "סה\"כ משתמשים"; $t['Total Video Comments'] = "סה\"כ תגובות וידאו"; $t['Total Videos'] = "סה\"כ סרטונים"; $t['Total Videos Dislikes'] = "סה\"כ סרטונים לא אוהבים"; $t['Total Videos Likes'] = "סך הכל אוהב סרטונים"; $t['Total Videos Views'] = "סה\"כ צפיות וידאו"; $t['Total Views'] = "סה\"כ צפיות"; $t['Total Views (90 Days)'] = "סה\"כ צפיות (90 ימים)"; $t['Total Views (Today)'] = "סה\"כ צפיות (היום)"; $t['Total Views Today'] = "סה\"כ צפיות היום"; $t['Track your videos with Google analytics'] = "עקוב אחר הסרטונים שלך באמצעות Google analytics"; $t['Trailer'] = "טריילר"; $t['Transfer Funds'] = "העבר כספים"; $t['Transfer Funds to'] = "העברת כספים ל"; $t['Transfer now'] = "העבר כעת"; $t['Translated Array'] = "מערך מתורגם"; $t['Trending'] = "מגמות"; $t['Trying to establish a chat server connection'] = "מנסה ליצור חיבור לשרת צ'אט"; $t['Type'] = "הקלד"; $t['Type the code'] = "הקלד את הקוד"; $t['Type your message...'] = "הקלד את ההודעה שלך ..."; $t['URL'] = "כתובת אתר"; $t['URL Friendly'] = "כתובת אתר ידידותית"; $t['URL Iframe'] = "כתובת אתר של iframe"; $t['UUID can\'t be blank'] = "UUID לא יכול להיות ריק"; $t['Unable to open file!'] = "אין אפשרות לפתוח את הקובץ!"; $t['Uncheck all to make it public'] = "בטל את סימון הכל כדי להפוך אותו לציבורי"; $t['Under 17 requires accompanying parent or adult guardian'] = "מתחת לגיל 17 נדרשת ההורה המלווה או האפוטרופוס המבוגר"; $t['Unique Users'] = "משתמשים ייחודיים"; $t['United States Only'] = "ארצות הברית בלבד"; $t['Unknown User'] = "משתמש לא ידוע"; $t['Unlisted'] = "לא רשום"; $t['Unsuggest'] = "לא מוצדקת"; $t['Up'] = "למעלה"; $t['Up Next'] = "הבא"; $t['Upcoming Events'] = "אירועים קרובים"; $t['Update Now'] = "עדכן כעת"; $t['Update Version'] = "עדכון גירסא"; $t['Update AVideo System'] = "עדכון מערכת AVideo"; $t['Update the site configuration'] = "עדכן את תצורת האתר"; $t['Update version'] = "עדכון גירסא"; $t['Update your user'] = "עדכן את המשתמש שלך"; $t['Upload'] = "העלה"; $t['Upload a Background'] = "טען רקע"; $t['Upload a Document Image'] = "העלה תמונת מסמך"; $t['Upload a MP4 File'] = "העלה קובץ MP4"; $t['Upload a Photo'] = "להעלות תמונה"; $t['Upload a Plugin'] = "העלה פלאגין"; $t['Upload a Plugin ZIP File'] = "טען קובץ ZIP Plugin"; $t['Upload a logo'] = "העלה לוגו"; $t['Upload to YouTube'] = "העלה ל- YouTube"; $t['Upload your file'] = "העלה את הקובץ שלך"; $t['Uploaded By'] = "הועלה על ידי"; $t['Use tls OR ssl'] = "השתמש ב- tls או ב- SSL"; $t['User'] = "משתמש"; $t['User Form'] = "טופס משתמש"; $t['User Groups'] = "קבוצות משתמש"; $t['User Groups Form'] = "טופס קבוצות משתמשים"; $t['User Info'] = "פרטי משתמש"; $t['User PPV'] = "משתמש PPV"; $t['User already exists'] = "משתמש כבר קיים"; $t['User and Password can not be blank'] = "המשתמש והסיסמה אינם יכולים להיות ריקים"; $t['User can not be blank'] = "המשתמש אינו יכול להיות ריק"; $t['User name already exists'] = "שם משתמש כבר קיים"; $t['User not found'] = "המשתמש לא נמצא"; $t['UserGroups'] = "קבוצות משתמש"; $t['Username or Email'] = "שם משתמש או דוא\"ל"; $t['Users'] = "משתמשים"; $t['Users Groups'] = "קבוצות משתמשים"; $t['Users linked'] = "משתמשים מקושרים"; $t['VMAP Link'] = "קישור VMAP"; $t['Value'] = "ערך"; $t['Verification Sent'] = "נשלח אימות"; $t['Verify'] = "אמת"; $t['Verify e-mail'] = "וודא כתובת אימייל"; $t['Video'] = "וידאו"; $t['Video Chart'] = "תרשים וידאו"; $t['Video Form'] = "טופס וידאו"; $t['Video Link'] = "קישור לסרטון"; $t['Video Owner'] = "בעלים של סרטון"; $t['Video Redirect URI'] = "כתובת אתר להפניה מחדש של סרטון"; $t['Video URL'] = "לינק לוידאו"; $t['Video Views'] = "צפיות וידאו"; $t['Video re-encoding!'] = "קידוד מחדש של וידאו!"; $t['Video thumbs up - per Channel'] = "האגודלים של סרטון - לכל ערוץ"; $t['Video views - per Channel'] = "צפיות בסרטון - לכל ערוץ"; $t['Videos'] = "סרטונים"; $t['Videos linked'] = "הסרטונים מקושרים"; $t['View'] = "נוף"; $t['View Details'] = "הצג פרטים"; $t['View all replies'] = "הצג את כל התשובות"; $t['Views'] = "צפיות"; $t['Views Left'] = "צפיות שמאלה"; $t['Visibility'] = "חשיפה"; $t['Volume'] = "כרך"; $t['Wallet'] = "ארנק"; $t['Want to subscribe to this channel?'] = "רוצה להירשם לערוץ זה?"; $t['Want to watch this again later?'] = "רוצה לראות את זה שוב מאוחר יותר?"; $t['Warning'] = "אזהרה"; $t['Watch Now'] = "צפה עכשיו"; $t['Watch on YouTube'] = "צפה ב- YouTube"; $t['Watching Now'] = "צופה עכשיו"; $t['We could not add you on the plan, we also refund you the payment'] = "לא הצלחנו להוסיף אותך בתוכנית, אנו גם מחזירים לך את התשלום"; $t['We could not notify anyone ({$email}, {$siteOwnerEmail}), but we marked it as a inapropriated'] = "לא הצלחנו ליידע אף אחד ({\$email}, {\$siteOwnerEmail}), אך סימנו אותו כבלתי מנוצל"; $t['We could not notify the video owner {$email}, but we marked it as a inapropriated'] = "לא הצלחנו ליידע את בעל הסרטון {\$email}, אך סימנו אותו כבלתי מנוצל"; $t['We could not notify the video owner {$siteOwnerEmail}, but we marked it as a inapropriated'] = "לא הצלחנו ליידע את בעל הסרטון {\$siteOwnerEmail}, אך סימנו אותו כבלתי מנוצל"; $t['We detected a total of %s pending updates, if you want to do it now click (Update Now) button'] = "גילינו סך של% s ממתינים עדכוני, אם אתה רוצה לעשות את זה עכשיו לחץ על (עדכן עכשיו) כפתור"; $t['We go live in...'] = "אנחנו הולכים לחיות ..."; $t['We have not found any videos or audios to show'] = "לא מצאנו סרטונים או סרטונים להצגה"; $t['We sent you an e-mail with instructions'] = "שלחנו לך מייל עם הוראות"; $t['We use youtube-dl to download videos from youtube.com or other video platforms'] = "אנו משתמשים ב- YouTube-dl כדי להוריד סרטונים מ- youtube.com או מפלטפורמות וידאו אחרות"; $t['We will check if there is a stream conflict before stream'] = "אנו נבדוק אם יש התנגשות בין הזרם לפני הזרם"; $t['We will send you a link, to your e-mail, to recover your password!'] = "אנו נשלח לך קישור, אל הדואר האלקטרוני שלך, כדי לשחזר את הסיסמה שלך!"; $t['We would like to thanks http://bootswatch.com/'] = "ברצוננו להודות http://bootswatch.com/"; $t['Web site title'] = "כותרת האתר"; $t['WebCam Streaming'] = "הזרמת Webcam"; $t['Website'] = "אתר אינטרנט"; $t['What is User Groups'] = "מה זה קבוצות משתמשים"; $t['What is the new name?'] = "מהו השם החדש?"; $t['When autoplay is enabled, a suggested video will automatically play next.'] = "כאשר ההפעלה האוטומטית מופעלת, סרטון מוצע יופעל באופן אוטומטי הבא."; $t['When you are watching media, you can use these keyboard-shortcuts.'] = "כאשר אתה צופה בתקשורת, באפשרותך להשתמש בקיצורי מקשים אלה."; $t['Withdraw Funds'] = "למשוך כספים"; $t['Word Translations'] = "תרגומי Word"; $t['World Wide'] = "עולמי"; $t['Would you like to unmute it?'] = "האם ברצונך לבטל השתקה?"; $t['Yes'] = "כן"; $t['Yes, delete it!'] = "כן, מחק אותו!"; $t['Yes, report it!'] = "כן, דווח על כך!"; $t['Yes, transfer it!'] = "כן, להעביר אותו!"; $t['Yes, unmute it!'] = "כן, בטל השתקה!"; $t['You already report this video'] = "אתה כבר מדווח על הסרטון הזה"; $t['You already sign up for this plan'] = "כבר נרשמת לתוכנית זו"; $t['You are hosting %d minutes and %d seconds of video'] = "אתה מארח% d דקות ו-% d שניות של סרטון"; $t['You are just one click away from starting your journey with %s!'] = "אתה רק במרחק קליק אחד החל את המסע שלך עם% s!"; $t['You are not allowed see this streaming'] = "אינך רשאי לראות את הזרמה הזו"; $t['You are not online, loading webcam...'] = "אינך מחובר לאינטרנט, טוען מצלמת אינטרנט ..."; $t['You are online now, web cam is disabled'] = "אתה מחובר עכשיו, מצלמת אינטרנט מושבת"; $t['You are running AVideo version %s!'] = "אתה מפעיל את גרסת AVideo% s!"; $t['You asked for a recover link, click on the provided link'] = "ביקשת קישור להתאוששות, לחץ על הקישור שסופק"; $t['You can not Manage This Video'] = "לא ניתן לנהל את הסרטון הזה"; $t['You can not do this'] = "אתה לא יכול לעשות את זה"; $t['You can not manage categories'] = "לא ניתן לנהל קטגוריות"; $t['You can not manage comments'] = "לא ניתן לנהל תגובות"; $t['You can not manage plugins'] = "לא ניתן לנהל יישומי פלאגין"; $t['You can not manage subscribes'] = "לא ניתן לנהל מנויים"; $t['You can not manage this plugin'] = "לא ניתן לנהל את הפלאגין הזה"; $t['You can not manage users'] = "אינך יכול לנהל משתמשים"; $t['You can not manage videos'] = "לא ניתן לנהל סרטונים"; $t['You can not manager'] = "אינך יכול לנהל"; $t['You can not manager plugin'] = "לא ניתן לנהל את הפלאגין"; $t['You can not manager plugin Audit'] = "לא ניתן לנהל את התוסף של הביקורת"; $t['You can not manager plugin add logo'] = "אתה לא יכול מנהל plugin להוסיף הלוגו"; $t['You can not manager plugin customize'] = "לא ניתן להתאים אישית את הפלאגין של המנהל"; $t['You can not manager plugin logo overlay'] = "אתה לא יכול מנהל plugin שכבת הלוגו"; $t['You can not manager plugin this'] = "לא ניתן לנהל את הפלאגין הזה"; $t['You can not manager plugins'] = "לא ניתן לנהל יישומי פלאגין"; $t['You can not manager wallets'] = "אתה לא יכול לנהל את הארנקים"; $t['You can not notify'] = "אינך יכול להודיע"; $t['You can not stream live videos'] = "לא ניתן להזרים סרטונים חיים"; $t['You can storage %s minutes of videos!'] = "ניתן לאחסן% s דקות של סרטונים!"; $t['You can upload max of %s!'] = "אתה יכול להעלות מקסימום של% s!"; $t['You can use our public encoder on'] = "ניתן להשתמש במפענח הציבורי שלנו ב-"; $t['You cannot comment on videos'] = "אינך יכול להגיב על סרטונים"; $t['You do not have an e-mail'] = "אין לך דואר אלקטרוני"; $t['You have %s minutes of videos!'] = "יש לך% s דקות של סרטונים!"; $t['You have about %s minutes left of video storage!'] = "נותרו לך כ-% s משמאל לאחסון הסרטונים!"; $t['You have sent the notification'] = "שלחת את ההודעה"; $t['You have version '] = "יש לך גרסה"; $t['You must be logged'] = "עליך להיות מחובר"; $t['You must fill all fields'] = "עליך למלא את כל השדות"; $t['You must login to be able to comment on videos'] = "עליך להתחבר כדי שתוכל להגיב על סרטונים"; $t['You need a user and passsword to register'] = "אתה צריך משתמש וורד כדי לרשום"; $t['You need a video to generate statistics'] = "אתה צריך וידאו כדי ליצור נתונים סטטיסטיים"; $t['You need to inform what is your user!'] = "אתה צריך להודיע ​​מה הוא המשתמש שלך!"; $t['You need to install'] = "אתה צריך להתקין"; $t['You need to make the plugin dir writable before upload, run this command and refresh this page'] = "אתה צריך לעשות את plugin דיר writable לפני ההעלאה, להפעיל את הפקודה ולרענן את הדף"; $t['You need to make your locale folder writable'] = "אתה צריך לעשות את התיקייה המקומית לכתיבה"; $t['You need to set up an encoder server'] = "עליך להגדיר שרת מקודד"; $t['You need to tell us the new name?'] = "אתה צריך לספר לנו את השם החדש?"; $t['You will not be able to recover these videos!'] = "לא תוכל לשחזר את הסרטונים האלו!"; $t['You will not be able to recover this action!'] = "לא תוכל לשחזר פעולה זו!"; $t['You will not be able to recover this category!'] = "לא תוכל לשחזר קטגוריה זו!"; $t['You will not be able to recover this group!'] = "לא תוכל לשחזר קבוצה זו!"; $t['You will not be able to recover this video!'] = "לא תוכל לשחזר את הסרטון הזה!"; $t['You will not be able to recover this!'] = "לא תוכל לשחזר זאת!"; $t['You will not be able to recover!'] = "לא תוכל להתאושש!"; $t['Your %slocale dir is not writable'] = "ה-% slocale dir שלך אינו ניתן לכתיבה"; $t['Your Document has NOT been uploaded!'] = "המסמך שלך לא הועלה!"; $t['Your Document has been saved!'] = "המסמך נשמר!"; $t['Your Logo'] = "הלוגו שלך"; $t['Your Media is Muted'] = "המדיה שלך מושתקת"; $t['Your POST data is empty may be your vide file is too big for the host'] = "הנתונים POST שלך ריק יכול להיות קובץ הווידאו שלך גדול מדי עבור המארח"; $t['Your Password has been set'] = "הסיסמה שלך הוגדרה"; $t['Your Server Time is'] = "זמן השרת שלך הוא"; $t['Your analytics code is wrong'] = "קוד הניתוח שלך שגוי"; $t['Your cache has NOT been cleared!'] = "המטמון שלך לא נמחק!"; $t['Your cache has been cleared!'] = "המטמון שלך נמחק!"; $t['Your category has NOT been deleted!'] = "הקטגוריה שלך לא נמחקה!"; $t['Your category has NOT been saved!'] = "הקטגוריה שלך לא נשמרה!"; $t['Your category has been deleted!'] = "הקטגוריה שלך נמחקה!"; $t['Your category has been saved!'] = "הקטגוריה שלך נשמרה!"; $t['Your code is not valid'] = "הקוד שלך אינו חוקי"; $t['Your comment has NOT been deleted!'] = "ההערה שלך לא נמחקה!"; $t['Your comment has NOT been saved!'] = "ההערה שלך לא נשמרה!"; $t['Your comment has been saved!'] = "ההערה שלך נשמרה!"; $t['Your comment must be bigger then 5 characters!'] = "ההערה שלך צריכה להיות גדולה מ -5 תווים!"; $t['Your configurations has NOT been updated!'] = "התצורות שלך לא עודכנו!"; $t['Your configurations has been updated!'] = "התצורות שלך עודכנו!"; $t['Your event has been saved!'] = "האירוע שלך נשמר!"; $t['Your group has NOT been deleted!'] = "הקבוצה שלך לא נמחקה!"; $t['Your group has NOT been saved!'] = "הקבוצה שלך לא נשמרה!"; $t['Your group has been deleted!'] = "הקבוצה שלך נמחקה!"; $t['Your group has been saved!'] = "הקבוצה שלך נשמרה!"; $t['Your language has been saved!'] = "השפה שלך נשמרה!"; $t['Your link has been saved!'] = "הקישור שלך נשמר!"; $t['Your maximum file size is:'] = "גודל הקובץ המקסימלי שלך הוא:"; $t['Your message could not be sent!'] = "לא ניתן לשלוח את ההודעה שלך!"; $t['Your message has been sent!'] = "הודעתך נשלחה!"; $t['Your new password could not be set!'] = "לא ניתן להגדיר את הסיסמה החדשה שלך!"; $t['Your new password has been set!'] = "הסיסמה החדשה שלך הוגדרה!"; $t['Your password does not match!'] = "הסיסמה שלך אינה תואמת!"; $t['Your plan could not be deleted!'] = "לא ניתן למחוק את התוכנית שלך!"; $t['Your plan could not be saved!'] = "לא ניתן לשמור את התוכנית שלך!"; $t['Your plan has been deleted!'] = "התוכנית שלך נמחקה!"; $t['Your plan has been saved!'] = "התוכנית שלך נשמרה!"; $t['Your promotion has been canceled'] = "הקידום שלך בוטל"; $t['Your register has been saved!'] = "הרישום שלך נשמר!"; $t['Your request was sent'] = "הבקשה שלך נשלחה"; $t['Your subscription could not be saved!'] = "לא ניתן היה לשמור את המנוי שלך!"; $t['Your subscription has been saved!'] = "המנוי שלך נשמר!"; $t['Your subtitle has NOT been uploaded!'] = "כותרת המשנה שלך לא הועלתה!"; $t['Your subtitle has been saved!'] = "כותרת המשנה שלך נשמרה!"; $t['Your system is up to date'] = "המערכת שלך מעודכנת"; $t['Your update from file %s is done, click continue'] = "העדכון שלך מהקובץ% s נעשה, לחץ על המשך"; $t['Your user has NOT been created!'] = "המשתמש שלך לא נוצר!"; $t['Your user has NOT been saved!'] = "המשתמש שלך לא נשמר!"; $t['Your user has NOT been updated!'] = "המשתמש שלך לא עודכן!"; $t['Your user has been created!'] = "המשתמש שלך נוצר!"; $t['Your user has been saved!'] = "המשתמש שלך נשמר!"; $t['Your user is not verified, we sent you a new e-mail'] = "המשתמש שלך לא אומת, שלחנו לך הודעת אימייל חדשה"; $t['Your user or password is wrong!'] = "המשתמש או הסיסמה שלך שגויים!"; $t['Your video %s was uploaded to your YouTube Account
'] = "הסרטון שלך % s < / a> הועלה אל חשבון YouTube "; $t['Your video download is complete, it is encoding now'] = "הורדת הסרטון שלך הושלמה, היא מקודדת כעת"; $t['Your video has NOT been deleted!'] = "הסרטון שלך לא נמחק!"; $t['Your video has NOT been saved!'] = "הסרטון שלך לא נשמר!"; $t['Your video has been promoted'] = "הסרטון שלך כבר מקודם"; $t['Your video is downloading now'] = "הסרטון שלך מוריד כעת"; $t['Your videos have NOT been deleted!'] = "הסרטונים שלך לא נמחקו!"; $t['Zip Code'] = "מיקוד"; $t['about'] = "על אודות"; $t['ago'] = "לפני"; $t['arrow'] = "חץ"; $t['audioOnly'] = "אודיו"; $t['cat'] = "חתול"; $t['categories'] = "קטגוריות"; $t['channel'] = "ערוץ"; $t['charts'] = "תרשימים"; $t['contact'] = "איש קשר"; $t['day'] = "יום"; $t['days'] = "ימים"; $t['description'] = "תיאור"; $t['help'] = "עזרה"; $t['hour'] = "שעה"; $t['hours'] = "שעות"; $t['info'] = "מידע"; $t['installed , but your database is not up to date. This could lead to bugs. Please go to the update-site.'] = "מותקן, אך מסד הנתונים שלך אינו מעודכן. זה יכול להוביל באגים. עבור אל אתר העדכונים."; $t['is Active'] = "הוא פעיל"; $t['is Admin'] = "הוא מנהל"; $t['language'] = "שפה"; $t['login'] = "התחברות"; $t['logoff'] = "להתנתק"; $t['minute'] = "דקה"; $t['minutes'] = "דקות"; $t['month'] = "חודש"; $t['months'] = "חודשים"; $t['mvideos'] = "mvideos"; $t['newest'] = "החדש ביותר"; $t['oldest'] = "הוותיק ביותר"; $t['orphanFiles'] = "יתומים"; $t['pause'] = "שתיקה"; $t['remaining'] = "הנותרים"; $t['right'] = "ימין"; $t['second'] = "השני"; $t['seconds'] = "שניות"; $t['signUp'] = "הירשם"; $t['siteConfigurations'] = "אתר תצורות"; $t['space'] = "חלל"; $t['subscribes'] = "מנויים"; $t['update'] = "עדכון"; $t['user'] = "משתמש"; $t['users'] = "משתמשים"; $t['usersGroups'] = "שמשתמשים"; $t['videoOnly'] = "וידאו בלבד"; $t['videosList'] = "סרטונים"; $t['week'] = "שבוע"; $t['weeks'] = "שבועות"; $t['year'] = "שנה"; $t['years'] = "שנים"; $t['youtube-dl uses Python and some servers does not came with python as dafault, to install Python type:'] = "youtube-dl משתמשת בפייתון וכמה שרתים לא הגיעו עם python כמו dafault, כדי להתקין סוג פייתון:"; \ No newline at end of file diff --git a/locale/sa.php b/locale/sa.php index 6540f90a2..c3da270aa 100644 --- a/locale/sa.php +++ b/locale/sa.php @@ -1,152 +1,153 @@ AVideo! is an video-sharing website, The service was created by Daniel Neto in march 2017.

The software allow you to upload, view, share and comment on videos, and it makes use of WebM and H.264/MPEG-4 AVC to display a wide variety of user-generated and corporate media videos.

Best of all, AVideo! is an open source solution that is freely available to everyone.

'] = "

يوفبتوب! هو موقع مشاركة الفيديو، تم إنشاء الخدمة من قبل دانيال نيتو في مارس 2017.

البرنامج يسمح لك لتحميل وعرض ومشاركة والتعليق على أشرطة الفيديو، ويستفيد من ويب و H.264 / مبيغ-4 أفك لعرض مجموعة واسعة من أشرطة الفيديو وسائل الإعلام التي أنشأها المستخدم والشركات.

أفضل للجميع، يوفبتوب! هو حل مفتوح المصدر متاح مجانا للجميع.

"; $t['About AVideo!'] = "حول يوفبتوب!"; $t['About'] = "حول"; $t['Activate'] = "تفعيل"; $t['Active'] = "نشيط"; $t['All categories'] = "جميع الفئات"; $t['Are you sure?'] = "هل أنت واثق؟"; $t['Audios and Videos'] = "صوتيات والفيديو"; $t['Audios'] = "صوتيات"; $t['Browse'] = "تصفح"; $t['Category Form'] = "نموذج الفئة"; $t['Category'] = "الفئة"; $t['Clean Name'] = "اسم النظيفة"; $t['Clean Title'] = "عنوان نظيف"; $t['Close'] = "قريب"; $t['Comment'] = "تعليق"; $t['Comments'] = "تعليقات"; $t['Configuration'] = "ترتيب"; $t['Confirm New Password'] = "تأكيد كلمة المرور الجديدة"; $t['Congratulations!'] = "تهانينا!"; $t['Congratulations'] = "تهانينا"; $t['Contact Us Today!'] = "اتصل بنا اليوم!"; $t['Contact'] = "اتصل"; $t['Continue'] = "استمر"; $t['Copy to Clipboard'] = "نسخ إلى الحافظة"; $t['Copy'] = "نسخ"; $t['Created'] = "خلقت"; $t['Delete'] = "حذف"; $t['Description'] = "وصف"; $t['Drop Here'] = "إسقاط هنا"; $t['Duration'] = "المدة الزمنية"; $t['E-mail Address'] = "عنوان البريد الإلكتروني"; $t['E-mail'] = "البريد الإلكتروني"; $t['Edit'] = "تصحيح"; $t['ID'] = "هوية شخصية"; $t['If you can\'t view this video, your browser does not support HTML5 videos'] = "إذا لم تتمكن من مشاهدة هذا الفيديو، فإن متصفحك لا يدعم مقاطع فيديو HTML5"; $t['Inactivate'] = "تعطيل"; $t['Inactive'] = "غير نشط"; $t['Is Admin'] = "هو المشرف"; $t['is Admin'] = "هو المشرف"; $t['Language'] = "لغة"; $t['Login'] = "تسجيل الدخول"; $t['Logoff'] = "إطفاء"; $t['Manager Audios and Videos'] = "مدير صوتيات والفيديو"; $t['Manager Categories'] = "مدير الفئات"; $t['Manager Users'] = "مدير المستخدمين"; $t['Message could not be sent'] = "تعذر إرسال الرسالة"; $t['Message sent'] = "تم الارسال"; $t['Message'] = "رسالة"; $t['Modified'] = "تم التعديل"; $t['Name'] = "اسم"; $t['New Category'] = "فئة جديدة"; $t['New Password'] = "كلمة السر الجديدة"; $t['New User'] = "مستخدم جديد"; $t['Original words found'] = "الكلمات الأصلية وجدت"; $t['Password'] = "كلمه السر"; $t['Paste here the translated words, one each line'] = "لصق هنا الكلمات المترجمة، واحد كل سطر"; $t['Permission denied'] = "طلب الاذن مرفوض"; $t['Please sign in'] = "الرجاء تسجيل الدخول"; $t['Re-encode Audio'] = "إعادة ترميز الصوت"; $t['Re-encode Image'] = "أعد ترميز الصورة"; $t['Re-encode Video'] = "أعد ترميز الفيديو"; $t['Recommended resolutions'] = "القرارات الموصى بها"; $t['Refresh'] = "تحديث"; $t['remaining'] = "المتبقي"; $t['Save changes'] = "حفظ التغييرات"; $t['Save File'] = "حفظ الملف"; $t['Save'] = "حفظ"; $t['Search'] = "بحث"; $t['Select a Language Flag'] = "حدد لغة العلم"; $t['Select the update'] = "حدد التحديث"; $t['Send'] = "إرسال"; $t['Share Video'] = "شارك الفيديو"; $t['Sign in'] = "تسجيل الدخول"; $t['Site Configurations'] = "تكوينات الموقع"; $t['Sorry!'] = "معذرة!"; $t['Sorry'] = "معذرة"; $t['Status'] = "الحالة"; $t['The original file for this video does not exists anymore'] = "لم يعد الملف الأصلي لهذا الفيديو متوفرا"; $t['This e-mail will be used for this web site notifications'] = "سيتم استخدام هذا البريد الإلكتروني لإشعارات موقع الويب هذا"; $t['This value must match with the language files on'] = "يجب أن تتطابق هذه القيمة مع ملفات اللغة"; $t['Title'] = "عنوان"; $t['Translated Array'] = "صفيف مترجم"; $t['Type the code'] = "اكتب الرمز"; $t['Type'] = "اكتب"; $t['Unable to open file!'] = "غير قادر على فتح ملف!"; $t['Update Now'] = "تحديث الان"; $t['Update the site configuration'] = "تحديث تكوين الموقع"; $t['Update version'] = "تحديث الإصدار"; $t['Update AVideo System'] = "تحديث نظام يوفبتيوب"; $t['Update your user'] = "تحديث المستخدم"; $t['Upload your file'] = "حمل الملف"; $t['Use one of the recommended resolutions'] = "استخدم أحد القرارات الموصى بها"; $t['User Form'] = "نموذج المستخدم"; $t['User'] = "المستعمل"; $t['Users'] = "المستخدمون"; $t['Video and Audio Upload'] = "تحميل الفيديو والصوت"; $t['Video Form'] = "نموذج الفيديو"; $t['Video re-encoding!'] = "إعادة ترميز الفيديو!"; $t['Video Resolution'] = "دقة الفيديو"; $t['Videos'] = "أشرطة فيديو"; $t['Views'] = "الآراء"; $t['Warning'] = "تحذير"; $t['We detected a total of %d pending updates, if you want to do it now click (Update Now) button'] = "لقد اكتشفنا ما مجموعه٪ d من التحديثات المعلقة، إذا كنت تريد إجراء ذلك الآن، فانقر على الزر (تحديث الآن)"; $t['We have not found any videos or audios to show'] = "لم يتم العثور على أي أشرطة الفيديو أو صوتيات لإظهار"; $t['Web site title'] = "عنوان الموقع"; $t['Website'] = "موقع الكتروني"; $t['Welcome %s, update your informations'] = "مرحبا %s، تحديث المعلومات الخاصة بك"; $t['Word Translations'] = "ترجمة الكلمات"; $t['Yes, delete it!'] = "نعم، حذفه!"; $t['You are running AVideo version %s!'] = "أنت تقوم بتشغيل٪ يوفبتيوب الإصدار %s!"; $t['You can not manage categories'] = "لا يمكنك إدارة الفئات"; $t['You can not manage users'] = "لا يمكنك إدارة المستخدمين"; $t['You can not manage videos'] = "لا يمكنك إدارة مقاطع الفيديو"; $t['You need a user and passsword to register'] = "كنت في حاجة الى مستخدم و باسورد للتسجيل"; $t['You need to make your locale folder writable'] = "تحتاج إلى جعل مجلد اللغة للكتابة"; $t['You will not be able to recover this category!'] = "لن تكون قادرا على استرداد هذه الفئة!"; $t['You will not be able to recover this user!'] = "لن تكون قادرا على استرداد هذا المستخدم!"; $t['You will not be able to recover this video!'] = "لن تتمكن من استرداد هذا الفيديو!"; $t['Your %slocale dir is not writable'] = "%slocale سلوك غير قابل للكتابة"; $t['Your category has been deleted!'] = "تم حذف الفئة الخاصة بك!"; $t['Your category has been saved!'] = "تم حفظ الفئة الخاصة بك!"; $t['Your category has NOT been deleted!'] = "لم يتم حذف الفئة الخاصة بك!"; $t['Your category has NOT been saved!'] = "لم يتم حفظ الفئة الخاصة بك!"; $t['Your code is not valid'] = "الرمز غير صالح"; $t['Your comment has been saved!'] = "تم حفظ تعليقك!"; $t['Your comment has NOT been saved!'] = "لم يتم حفظ تعليقك!"; $t['Your comment must be bigger then 5 characters!'] = "يجب أن يكون تعليقك أكبر ثم 5 أحرف!"; $t['Your configurations has been updated!'] = "تم تحديث التهيئات الخاصة بك!"; $t['Your configurations has NOT been updated!'] = "لم يتم تحديث التهيئات الخاصة بك!"; $t['Your encode video resolution is set to %s !'] = "تم تعيين دقة الفيديو المشفرة على %s!"; $t['Your language has been saved!'] = "تم حفظ اللغة الخاصة بك!"; $t['Your maximum file size is:'] = "الحد الأقصى لحجم الملف هو:"; $t['Your message could not be sent!'] = "لا يمكن ارسال رسالتك!"; $t['Your message has been sent!'] = "تم ارسال رسالتك!"; $t['Your password does not match!'] = "كلمة المرور غير متطابقة!"; $t['Your system is up to date'] = "النظام الخاص بك هو حتى الآن"; $t['Your update from file %s is done, click continue'] = "تم إجراء التحديث من الملف %s، ثم انقر على متابعة"; $t['Your user has been deleted!'] = "تم حذف المستخدم الخاص بك!"; $t['Your user has been saved!'] = "تم حفظ المستخدم الخاص بك!"; $t['Your user has been updated!'] = "تم تحديث المستخدم الخاص بك!"; $t['Your user has NOT been deleted!'] = "لم يتم حذف المستخدم الخاص بك!"; $t['Your user has NOT been saved!'] = "لم يتم حفظ المستخدم الخاص بك!"; $t['Your user has NOT been updated!'] = "لم يتم تحديث المستخدم الخاص بك!"; $t['Your user or password is wrong!'] = "المستخدم أو كلمة المرور خاطئة!"; $t['Your video has been deleted!'] = "تم حذف الفيديو الخاص بك!"; $t['Your video has been saved!'] = "تم حفظ الفيديو الخاص بك!"; $t['Your video has NOT been deleted!'] = "لم يتم حذف الفيديو الخاص بك!"; $t['Your video has NOT been saved!'] = "لم يتم حفظ الفيديو الخاص بك!"; diff --git a/objects/functions.php b/objects/functions.php index a643f8f3b..9d958827a 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -1,5089 +1,5090 @@ 0 && $upload_max < $max_size) { $max_size = $upload_max; } } return $max_size; } function parse_size($size) { $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. if ($unit) { // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. return round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); } else { return round($size); } } function humanFileSize($size, $unit = "") { if ((!$unit && $size >= 1 << 30) || $unit == "GB") { return number_format($size / (1 << 30), 2) . "GB"; } if ((!$unit && $size >= 1 << 20) || $unit == "MB") { return number_format($size / (1 << 20), 2) . "MB"; } if ((!$unit && $size >= 1 << 10) || $unit == "KB") { return number_format($size / (1 << 10), 2) . "KB"; } return number_format($size) . " bytes"; } function get_max_file_size() { return humanFileSize(file_upload_max_size()); } function humanTiming($time, $precision = 0) { if (!is_int($time)) { $time = strtotime($time); } $time = time() - $time; // to get the time since that moment return secondsToHumanTiming($time, $precision); } function humanTimingAgo($time, $precision = 0) { if (!is_int($time)) { $time = strtotime($time); } $time = time() - $time; // to get the time since that moment if (empty($time)) { return __("Now"); } return secondsToHumanTiming($time, $precision) . " " . __("ago"); } function secondsToHumanTiming($time, $precision = 0) { if (empty($time)) { return __("Now"); } $time = ($time < 0) ? $time * -1 : $time; $time = ($time < 1) ? 1 : $time; $tokens = array( 31536000 => 'year', 2592000 => 'month', 604800 => 'week', 86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second', ); /** * For detection propouse only */ __('year'); __('month'); __('week'); __('day'); __('hour'); __('minute'); __('second'); __('years'); __('months'); __('weeks'); __('days'); __('hours'); __('minutes'); __('seconds'); foreach ($tokens as $unit => $text) { if ($time < $unit) { continue; } $numberOfUnits = floor($time / $unit); if ($numberOfUnits > 1) { $text = __($text . "s"); } else { $text = __($text); } if ($precision) { $rest = $time % $unit; if ($rest) { $text .= ' ' . secondsToHumanTiming($rest, $precision - 1); } } return $numberOfUnits . ' ' . $text; } } function checkVideosDir() { $dir = "../videos"; if (file_exists($dir)) { return is_writable($dir); } return mkdir($dir); } function isApache() { return (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false); } function isPHP($version = "'7.0.0'") { return (version_compare(PHP_VERSION, $version) >= 0); } function modEnabled($mod_name) { if (!function_exists('apache_get_modules')) { ob_start(); phpinfo(INFO_MODULES); $contents = ob_get_contents(); ob_end_clean(); return (strpos($contents, 'mod_' . $mod_name) !== false); } return in_array('mod_' . $mod_name, apache_get_modules()); } function modRewriteEnabled() { return modEnabled("rewrite"); } function modAliasEnabled() { return modEnabled("alias"); } function isFFMPEG() { return trim(shell_exec('which ffmpeg')); } function isUnzip() { return trim(shell_exec('which unzip')); } function isExifToo() { return trim(shell_exec('which exiftool')); } function getPathToApplication() { return str_replace("install/index.php", "", $_SERVER["SCRIPT_FILENAME"]); } function getURLToApplication() { $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = explode("install/index.php", $url); return $url[0]; } //max_execution_time = 7200 function check_max_execution_time() { $max_size = ini_get('max_execution_time'); $recomended_size = 7200; return ($recomended_size <= $max_size); } //post_max_size = 100M function check_post_max_size() { $max_size = parse_size(ini_get('post_max_size')); $recomended_size = parse_size('100M'); return ($recomended_size <= $max_size); } //upload_max_filesize = 100M function check_upload_max_filesize() { $max_size = parse_size(ini_get('upload_max_filesize')); $recomended_size = parse_size('100M'); return ($recomended_size <= $max_size); } //memory_limit = 100M function check_memory_limit() { $max_size = parse_size(ini_get('memory_limit')); $recomended_size = parse_size('512M'); return ($recomended_size <= $max_size); } function check_mysqlnd() { return function_exists('mysqli_fetch_all'); } function base64DataToImage($imgBase64) { $img = $imgBase64; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); return base64_decode($img); } function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (!empty($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } else { $ip = "127.0.0.1"; } return $ip; } function cleanString($text) { $utf8 = array( '/[áàâãªä]/u' => 'a', '/[ÁÀÂÃÄ]/u' => 'A', '/[ÍÌÎÏ]/u' => 'I', '/[íìîï]/u' => 'i', '/[éèêë]/u' => 'e', '/[ÉÈÊË]/u' => 'E', '/[óòôõºö]/u' => 'o', '/[ÓÒÔÕÖ]/u' => 'O', '/[úùûü]/u' => 'u', '/[ÚÙÛÜ]/u' => 'U', '/ç/' => 'c', '/Ç/' => 'C', '/ñ/' => 'n', '/Ñ/' => 'N', '/–/' => '-', // UTF-8 hyphen to 'normal' hyphen '/[’‘‹›‚]/u' => ' ', // Literally a single quote '/[“”«»„]/u' => ' ', // Double quote '/ /' => ' ', // nonbreaking space (equiv. to 0x160) '/Є/' => 'YE', '/І/' => 'I', '/Ѓ/' => 'G', '/і/' => 'i', '/№/' => '#', '/є/' => 'ye', '/ѓ/' => 'g', '/А/' => 'A', '/Б/' => 'B', '/В/' => 'V', '/Г/' => 'G', '/Д/' => 'D', '/Е/' => 'E', '/Ё/' => 'YO', '/Ж/' => 'ZH', '/З/' => 'Z', '/И/' => 'I', '/Й/' => 'J', '/К/' => 'K', '/Л/' => 'L', '/М/' => 'M', '/Н/' => 'N', '/О/' => 'O', '/П/' => 'P', '/Р/' => 'R', '/С/' => 'S', '/Т/' => 'T', '/У/' => 'U', '/Ф/' => 'F', '/Х/' => 'H', '/Ц/' => 'C', '/Ч/' => 'CH', '/Ш/' => 'SH', '/Щ/' => 'SHH', '/Ъ/' => '', '/Ы/' => 'Y', '/Ь/' => '', '/Э/' => 'E', '/Ю/' => 'YU', '/Я/' => 'YA', '/а/' => 'a', '/б/' => 'b', '/в/' => 'v', '/г/' => 'g', '/д/' => 'd', '/е/' => 'e', '/ё/' => 'yo', '/ж/' => 'zh', '/з/' => 'z', '/и/' => 'i', '/й/' => 'j', '/к/' => 'k', '/л/' => 'l', '/м/' => 'm', '/н/' => 'n', '/о/' => 'o', '/п/' => 'p', '/р/' => 'r', '/с/' => 's', '/т/' => 't', '/у/' => 'u', '/ф/' => 'f', '/х/' => 'h', '/ц/' => 'c', '/ч/' => 'ch', '/ш/' => 'sh', '/щ/' => 'shh', '/ъ/' => '', '/ы/' => 'y', '/ь/' => '', '/э/' => 'e', '/ю/' => 'yu', '/я/' => 'ya', '/—/' => '-', '/«/' => '', '/»/' => '', '/…/' => '' ); return preg_replace(array_keys($utf8), array_values($utf8), $text); } function cleanURLName($name) { $name = preg_replace('/[!#$&\'()*+,\\/:;=?@[\\]%" ]+/', '-', trim(strtolower(cleanString($name)))); return trim(preg_replace('/[\x00-\x1F\x7F]/u', '', $name), "-"); } /** * @brief return true if running in CLI, false otherwise * if is set $_GET['ignoreCommandLineInterface'] will return false * @return boolean */ function isCommandLineInterface() { return (empty($_GET['ignoreCommandLineInterface']) && php_sapi_name() === 'cli'); } /** * @brief show status message as text (CLI) or JSON-encoded array (web) * * @param array $statusarray associative array with type/message pairs * @return string */ function status($statusarray) { if (isCommandLineInterface()) { foreach ($statusarray as $status => $message) { echo $status . ":" . $message . "\n"; } } else { echo json_encode(array_map(function ($text) { return nl2br($text); }, $statusarray)); } } /** * @brief show status message and die * * @param array $statusarray associative array with type/message pairs */ function croak($statusarray) { status($statusarray); die; } function getSecondsTotalVideosLength() { $configFile = dirname(__FILE__) . '/../videos/configuration.php'; require_once $configFile; global $global; if (!User::isLogged()) { return 0; } $sql = "SELECT * FROM videos v "; $formats = ""; $values = array(); if (!User::isAdmin()) { $id = User::getId(); $sql .= " WHERE users_id = ? "; $formats = "i"; $values = array($id); } $res = sqlDAL::readSql($sql, $formats, $values); $fullData = sqlDAL::fetchAllAssoc($res); sqlDAL::close($res); $seconds = 0; foreach ($fullData as $row) { $seconds += parseDurationToSeconds($row['duration']); } return $seconds; } function getMinutesTotalVideosLength() { $seconds = getSecondsTotalVideosLength(); return floor($seconds / 60); } function secondsToVideoTime($seconds) { if (!is_numeric($seconds)) { return $seconds; } $seconds = round($seconds); $hours = floor($seconds / 3600); $mins = floor($seconds / 60 % 60); $secs = floor($seconds % 60); return sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } function parseSecondsToDuration($seconds) { return secondsToVideoTime($seconds); } function parseDurationToSeconds($str) { if (is_numeric($str)) { return intval($str); } $durationParts = explode(":", $str); if (empty($durationParts[1]) || $durationParts[0] == "EE") { return 0; } if (empty($durationParts[2])) { $durationParts[2] = 0; } $minutes = intval(($durationParts[0]) * 60) + intval($durationParts[1]); return intval($durationParts[2]) + ($minutes * 60); } function durationToSeconds($str) { return parseDurationToSeconds($str); } function secondsToDuration($seconds) { return parseSecondsToDuration($seconds); } /** * * @global type $global * @param type $mail * call it before send mail to let AVideo decide the method */ function setSiteSendMessage(&$mail) { global $global; if (empty($_POST["comment"])) { $_POST["comment"] = ""; } require_once $global['systemRootPath'] . 'objects/configuration.php'; $config = new Configuration(); $mail->CharSet = 'UTF-8'; if ($config->getSmtp()) { _error_log("Sending SMTP Email"); $mail->CharSet = 'UTF-8'; $mail->IsSMTP(); // enable SMTP if (!empty($_POST) && $_POST["comment"] == "Teste of comment" && User::isAdmin()) { $mail->SMTPDebug = 3; $mail->Debugoutput = function ($str, $level) { _error_log("SMTP ERROR $level; message: $str", AVideoLog::$ERROR); }; } $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); $mail->SMTPAuth = $config->getSmtpAuth(); // authentication enabled $mail->SMTPSecure = $config->getSmtpSecure(); // secure transfer enabled REQUIRED for Gmail $mail->Host = $config->getSmtpHost(); $mail->Port = $config->getSmtpPort(); $mail->Username = $config->getSmtpUsername(); $mail->Password = $config->getSmtpPassword(); //_error_log(print_r($config, true)); } else { _error_log("Sending SendMail Email"); $mail->isSendmail(); } } function array_iunique($array) { return array_intersect_key($array, array_unique(array_map("strtolower", $array))); } function partition(array $list, $totalItens) { $listlen = count($list); _error_log("partition: listlen={$listlen} totalItens={$totalItens}"); $p = ceil($listlen / $totalItens); $partlen = floor($listlen / $p); $partition = array(); $mark = 0; for ($index = 0; $index < $p; $index++) { $partition[$index] = array_slice($list, $mark, $totalItens); $mark += $totalItens; } return $partition; } function sendSiteEmail($to, $subject, $message) { global $advancedCustom; if (empty($to)) { return false; } if (!is_array($to)) { $to = array($to); } if (empty($advancedCustom)) { $advancedCustom = AVideoPlugin::loadPlugin("CustomizeAdvanced"); } $subject = UTF8encode($subject); $message = UTF8encode($message); $message = createEmailMessageFromTemplate($message); _error_log("sendSiteEmail [" . count($to) . "] {$subject}"); global $config, $global; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/PHPMailer.php'; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/SMTP.php'; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/Exception.php'; $contactEmail = $config->getContactEmail(); $webSiteTitle = $config->getWebSiteTitle(); try { if (!is_array($to)) { $mail = new PHPMailer\PHPMailer\PHPMailer; setSiteSendMessage($mail); $mail->setFrom($contactEmail, $webSiteTitle); $mail->Subject = $subject . " - " . $webSiteTitle; $mail->msgHTML($message); $mail->addAddress($to); $resp = $mail->send(); if (!$resp) { _error_log("sendSiteEmail Error Info: {$mail->ErrorInfo}"); } else { _error_log("sendSiteEmail Success Info: $subject " . json_encode($to)); } } else { $size = intval(@$advancedCustom->splitBulkEmailSend); if (empty($size)) { $size = 90; } $to = array_iunique($to); $pieces = partition($to, $size); foreach ($pieces as $piece) { $mail = new PHPMailer\PHPMailer\PHPMailer; setSiteSendMessage($mail); $mail->setFrom($contactEmail, $webSiteTitle); $mail->Subject = $subject . " - " . $webSiteTitle; $mail->msgHTML($message); $count = 0; foreach ($piece as $value) { $count++; _error_log("sendSiteEmail::addBCC [{$count}] {$value}"); $mail->addBCC($value); } $resp = $mail->send(); if (!$resp) { _error_log("sendSiteEmail Error Info: {$mail->ErrorInfo}"); } else { _error_log("sendSiteEmail Success Info: $subject " . json_encode($to)); } } } //Set the subject line return $resp; } catch (phpmailerException $e) { _error_log($e->errorMessage()); //Pretty error messages from PHPMailer } catch (Exception $e) { _error_log($e->getMessage()); //Boring error messages from anything else! } } function createEmailMessageFromTemplate($message) { //check if the message already have a HTML body if (preg_match("/html>/i", $message)) { return $message; } global $global, $config; $text = file_get_contents("{$global['systemRootPath']}view/include/emailTemplate.html"); $siteTitle = $config->getWebSiteTitle(); $logo = "getLogo(true) . "\" alt=\"{$siteTitle}\">"; $words = array($logo, $message, $siteTitle); $replace = array('{logo}', '{message}', '{siteTitle}'); return str_replace($replace, $words, $text); } function sendEmailToSiteOwner($subject, $message) { global $advancedCustom; $subject = UTF8encode($subject); $message = UTF8encode($message); _error_log("sendEmailToSiteOwner {$subject}"); global $config, $global; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/PHPMailer.php'; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/SMTP.php'; require_once $global['systemRootPath'] . 'objects/PHPMailer/src/Exception.php'; $contactEmail = $config->getContactEmail(); $webSiteTitle = $config->getWebSiteTitle(); try { $mail = new PHPMailer\PHPMailer\PHPMailer; setSiteSendMessage($mail); $mail->setFrom($contactEmail, $webSiteTitle); $mail->Subject = $subject . " - " . $webSiteTitle; $mail->msgHTML($message); $mail->addAddress($contactEmail); $resp = $mail->send(); if (!$resp) { _error_log("sendEmailToSiteOwner Error Info: {$mail->ErrorInfo}"); } else { _error_log("sendEmailToSiteOwner Success Info: $subject " . json_encode($to)); } return $resp; } catch (phpmailerException $e) { _error_log($e->errorMessage()); //Pretty error messages from PHPMailer } catch (Exception $e) { _error_log($e->getMessage()); //Boring error messages from anything else! } } function parseVideos($videoString = null, $autoplay = 0, $loop = 0, $mute = 0, $showinfo = 0, $controls = 1, $time = 0, $objectFit = "") { //_error_log("parseVideos: $videoString"); if (strpos($videoString, 'youtube.com/embed') !== false) { return $videoString . (parse_url($videoString, PHP_URL_QUERY) ? '&' : '?') . 'modestbranding=1&showinfo=' . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; } if (strpos($videoString, 'iframe') !== false) { // retrieve the video url $anchorRegex = '/src="(.*)?"/isU'; $results = array(); if (preg_match($anchorRegex, $video, $results)) { $link = trim($results[1]); } } else { // we already have a url $link = $videoString; } if (stripos($link, 'embed') !== false) { return $link . (parse_url($link, PHP_URL_QUERY) ? '&' : '?') . 'modestbranding=1&showinfo=' . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time&objectFit=$objectFit"; } elseif (strpos($link, 'youtube.com') !== false) { preg_match( '/[\\?\\&]v=([^\\?\\&]+)/', $link, $matches ); //the ID of the YouTube URL: x6qe_kVaBpg if (empty($matches[1])) { return $link; } $id = $matches[1]; return '//www.youtube.com/embed/' . $id . '?modestbranding=1&showinfo=' . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; } elseif (strpos($link, 'youtu.be') !== false) { //https://youtu.be/9XXOBSsPoMU preg_match( '/youtu.be\/([a-zA-Z0-9_]+)($|\/)/', $link, $matches ); //the ID of the YouTube URL: x6qe_kVaBpg $id = $matches[1]; return '//www.youtube.com/embed/' . $id . '?modestbranding=1&showinfo=' . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&te=$time&objectFit=$objectFit"; } elseif (strpos($link, 'player.vimeo.com') !== false) { // works on: // http://player.vimeo.com/video/37985580?title=0&byline=0&portrait=0 $videoIdRegex = '/player.vimeo.com\/video\/([0-9]+)\??/i'; preg_match($videoIdRegex, $link, $matches); $id = $matches[1]; return '//player.vimeo.com/video/' . $id; } elseif (strpos($link, 'vimeo.com/channels') !== false) { //extract the ID preg_match( '/\/\/(www\.)?vimeo.com\/channels\/[a-z0-9-]+\/(\d+)($|\/)/i', $link, $matches ); //the ID of the Vimeo URL: 71673549 $id = $matches[2]; return '//player.vimeo.com/video/' . $id; } elseif (strpos($link, 'vimeo.com') !== false) { //extract the ID preg_match( '/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', $link, $matches ); //the ID of the Vimeo URL: 71673549 $id = $matches[2]; return '//player.vimeo.com/video/' . $id; } elseif (strpos($link, 'dailymotion.com') !== false) { //extract the ID preg_match( '/\/\/(www\.)?dailymotion.com\/video\/([a-zA-Z0-9_]+)($|\/)/', $link, $matches ); //the ID of the Vimeo URL: 71673549 $id = $matches[2]; return '//www.dailymotion.com/embed/video/' . $id; } elseif (strpos($link, 'metacafe.com') !== false) { //extract the ID preg_match( '/\/\/(www\.)?metacafe.com\/watch\/([a-zA-Z0-9_\/-]+)$/', $link, $matches ); $id = $matches[2]; return '//www.metacafe.com/embed/' . $id; } elseif (strpos($link, 'vid.me') !== false) { //extract the ID preg_match( '/\/\/(www\.)?vid.me\/([a-zA-Z0-9_-]+)$/', $link, $matches ); $id = $matches[2]; return '//vid.me/e/' . $id; } elseif (strpos($link, 'rutube.ru') !== false) { //extract the ID preg_match('/\/\/(www\.)?rutube.ru\/video\/([a-zA-Z0-9_-]+)\/.*/', $link, $matches); $id = $matches[2]; return '//rutube.ru/play/embed/' . $id; } elseif (strpos($link, 'ok.ru') !== false) { //extract the ID preg_match('/\/\/(www\.)?ok.ru\/video\/([a-zA-Z0-9_-]+)$/', $link, $matches); $id = $matches[2]; return '//ok.ru/videoembed/' . $id; } elseif (strpos($link, 'streamable.com') !== false) { //extract the ID preg_match('/\/\/(www\.)?streamable.com\/([a-zA-Z0-9_-]+)$/', $link, $matches); $id = $matches[2]; return '//streamable.com/s/' . $id; } elseif (strpos($link, 'twitch.tv/videos') !== false) { //extract the ID preg_match('/\/\/(www\.)?twitch.tv\/videos\/([a-zA-Z0-9_-]+)$/', $link, $matches); if (!empty($matches[2])) { $id = $matches[2]; return '//player.twitch.tv/?video=' . $id . '#'; } //extract the ID preg_match('/\/\/(www\.)?twitch.tv\/[a-zA-Z0-9_-]+\/v\/([a-zA-Z0-9_-]+)$/', $link, $matches); $id = $matches[2]; return '//player.twitch.tv/?video=' . $id . '#'; } elseif (strpos($link, 'twitch.tv') !== false) { //extract the ID preg_match('/\/\/(www\.)?twitch.tv\/([a-zA-Z0-9_-]+)$/', $link, $matches); $id = $matches[2]; return '//player.twitch.tv/?channel=' . $id . '#'; } elseif (strpos($link, '/evideo/') !== false) { //extract the ID preg_match('/(http.+)\/evideo\/([a-zA-Z0-9_-]+)($|\/)/i', $link, $matches); //the AVideo site $site = $matches[1]; $id = $matches[2]; return $site . '/evideoEmbed/' . $id . "?autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time"; } elseif (strpos($link, '/video/') !== false) { //extract the ID preg_match('/(http.+)\/video\/([a-zA-Z0-9_-]+)($|\/)/i', $link, $matches); //the AVideo site if (!empty($matches[1])) { $site = $matches[1]; $id = $matches[2]; return $site . '/videoEmbeded/' . $id . "?autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time"; } else { return $link; } } $url = $videoString; $url_parsed = parse_url($url); if (empty($url_parsed['query'])) { return ""; } $new_qs_parsed = array(); // Grab our first query string parse_str($url_parsed['query'], $new_qs_parsed); // Here's the other query string $other_query_string = 'modestbranding=1&showinfo=' . $showinfo . "&autoplay={$autoplay}&controls=$controls&loop=$loop&mute=$mute&t=$time"; $other_qs_parsed = array(); parse_str($other_query_string, $other_qs_parsed); // Stitch the two query strings together $final_query_string_array = array_merge($new_qs_parsed, $other_qs_parsed); $final_query_string = http_build_query($final_query_string_array); // Now, our final URL: $new_url = $url_parsed['scheme'] . '://' . $url_parsed['host'] . $url_parsed['path'] . '?' . $final_query_string; return $new_url; // return data } $canUseCDN = array(); function canUseCDN($videos_id) { if (empty($videos_id)) { return false; } global $global, $canUseCDN; if (!isset($canUseCDN[$videos_id])) { require_once $global['systemRootPath'] . 'plugin/VR360/Objects/VideosVR360.php'; $pvr360 = AVideoPlugin::isEnabledByName('VR360'); // if the VR360 is enabled you can not use the CDN, it fail to load the GL $isVR360Enabled = VideosVR360::isVR360Enabled($videos_id); if ($pvr360 && $isVR360Enabled) { $ret = false; } else { $ret = true; } //_error_log(json_encode(array('canUseCDN'=>$ret, '$pvr360'=>$pvr360, '$isVR360Enabled'=>$isVR360Enabled, '$videos_id'=>$videos_id))); $canUseCDN[$videos_id] = $ret; } return $canUseCDN[$videos_id]; } function clearVideosURL($fileName = "") { global $global; $path = getCacheDir() . "getVideosURL/"; if (empty($path)) { rrmdir($path); } else { $cacheFilename = "{$path}{$fileName}.cache"; @unlink($cacheFilename); } } function maxLifetime() { global $maxLifetime; if (!isset($maxLifetime)) { $aws_s3 = AVideoPlugin::getObjectDataIfEnabled('AWS_S3'); $bb_b2 = AVideoPlugin::getObjectDataIfEnabled('Blackblaze_B2'); $secure = AVideoPlugin::getObjectDataIfEnabled('SecureVideosDirectory'); $maxLifetime = 0; if (!empty($aws_s3) && !empty($aws_s3->presignedRequestSecondsTimeout) && (empty($maxLifetime) || $aws_s3->presignedRequestSecondsTimeout < $maxLifetime) ){ $maxLifetime = $aws_s3->presignedRequestSecondsTimeout; _error_log("maxLifetime: AWS_S3 = {$maxLifetime}"); } if (!empty($bb_b2) && !empty($aws_s3->presignedRequestSecondsTimeout) && (empty($maxLifetime) || $bb_b2->presignedRequestSecondsTimeout < $maxLifetime)) { $maxLifetime = $bb_b2->presignedRequestSecondsTimeout; _error_log("maxLifetime: B2 = {$maxLifetime}"); } if (!empty($secure) && !empty($aws_s3->tokenTimeOut) && (empty($maxLifetime) || $secure->tokenTimeOut < $maxLifetime)) { $maxLifetime = $secure->tokenTimeOut; _error_log("maxLifetime: Secure = {$maxLifetime}"); } } return $maxLifetime; } $cacheExpirationTime = false; function cacheExpirationTime() { if (isBot()) { return 604800; // 1 week } global $cacheExpirationTime; if (empty($cacheExpirationTime)) { $obj = AVideoPlugin::getObjectDataIfEnabled('Cache'); $cacheExpirationTime = @$obj->cacheTimeInSeconds; } return intval($cacheExpirationTime); } /** * tell if a file should recreate a cache, based on its time and the plugins toke expirations * @param type $filename * @return boolean */ function recreateCache($filename) { return (!file_exists($filename) || time() - filemtime($filename) > minimumExpirationTime()); } function _getImagesURL($fileName, $type) { global $global; $files = array(); $source = Video::getSourceFile($fileName, ".jpg"); $file = $source['path']; if (file_exists($file)) { $files["jpg"] = array( 'filename' => "{$fileName}.jpg", 'path' => $file, 'url' => $source['url'], 'type' => 'image', ); } else { $files["jpg"] = array( 'filename' => "{$type}.png", 'path' => "{$global['systemRootPath']}view/img/{$type}.png", 'url' => "{$global['webSiteRootURL']}view/img/{$type}.png", 'type' => 'image', ); } $source = Video::getSourceFile($fileName, "_portrait.jpg"); $file = $source['path']; if (file_exists($file)) { $files["pjpg"] = array( 'filename' => "{$fileName}_portrait.jpg", 'path' => $file, 'url' => $source['url'], 'type' => 'image', ); } elseif ($type != 'image') { $files["pjpg"] = array( 'filename' => "{$type}_portrait.png", 'path' => "{$global['systemRootPath']}view/img/{$type}_portrait.png", 'url' => "{$global['webSiteRootURL']}view/img/{$type}_portrait.png", 'type' => 'image', ); } return $files; } function getVideosURLPDF($fileName) { global $global; if (empty($fileName)) { return array(); } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $source = Video::getSourceFile($fileName, ".pdf"); $file = $source['path']; $files["pdf"] = array( 'filename' => "{$fileName}.pdf", 'path' => $file, 'url' => $source['url'], 'type' => 'pdf', ); $files = array_merge($files, _getImagesURL($fileName, 'pdf')); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //_error_log("getVideosURLPDF generated in {$total_time} seconds. fileName: $fileName "); return $files; } function getVideosURLIMAGE($fileName) { global $global; if (empty($fileName)) { return array(); } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $types = array('png', 'gif', 'webp', 'jpg'); foreach ($types as $value) { $source = Video::getSourceFile($fileName, ".{$value}"); $file = $source['path']; $files["image"] = array( 'filename' => "{$fileName}.{$value}", 'path' => $file, 'url' => $source['url'], 'type' => 'image', ); if (file_exists($file)) { break; } } $files = array_merge($files, _getImagesURL($fileName, 'image')); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //_error_log("getVideosURLPDF generated in {$total_time} seconds. fileName: $fileName "); return $files; } function getVideosURLZIP($fileName) { global $global; if (empty($fileName)) { return array(); } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $types = array('zip'); foreach ($types as $value) { $source = Video::getSourceFile($fileName, ".{$value}"); $file = $source['path']; $files["zip"] = array( 'filename' => "{$fileName}.zip", 'path' => $file, 'url' => $source['url'], 'type' => 'zip', ); if (file_exists($file)) { break; } } $files = array_merge($files, _getImagesURL($fileName, 'zip')); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //_error_log("getVideosURLPDF generated in {$total_time} seconds. fileName: $fileName "); return $files; } function getVideosURLArticle($fileName) { global $global; if (empty($fileName)) { return array(); } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; //$files = array_merge($files, _getImagesURL($fileName, 'article')); $files = _getImagesURL($fileName, 'article'); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //_error_log("getVideosURLPDF generated in {$total_time} seconds. fileName: $fileName "); return $files; } function getVideosURLAudio($fileName) { global $global; if (empty($fileName)) { return array(); } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $source = Video::getSourceFile($fileName, ".mp3"); $file = $source['path']; $files["mp3"] = array( 'filename' => "{$fileName}.mp3", 'path' => $file, 'url' => $source['url'], 'type' => 'audio', ); $files = array_merge($files, _getImagesURL($fileName, 'audio_wave')); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); //_error_log("getVideosURLAudio generated in {$total_time} seconds. fileName: $fileName "); return $files; } function getVideosURL($fileName, $cache = true) { return getVideosURL_V2($fileName); // disable this function soon } function getVideosURLMP4Only($fileName) { $allFiles = getVideosURL_V2($fileName); if (is_array($allFiles)) { foreach ($allFiles as $key => $value) { if ($value['format'] !== 'mp4') { unset($allFiles[$key]); } } return $allFiles; } _error_log("getVideosURLMP4Only does not return an ARRAY from getVideosURL_V2($fileName) " . json_encode($allFiles)); return array(); } function getVideosURLWEBMOnly($fileName) { $allFiles = getVideosURL_V2($fileName); // disable this function soon if (is_array($allFiles)) { foreach ($allFiles as $key => $value) { if ($value['format'] !== 'webm') { unset($allFiles[$key]); } } return $allFiles; } _error_log("getVideosURLMP4Only does not return an ARRAY from getVideosURL_V2($fileName) " . json_encode($allFiles)); return array(); } function getVideosURLMP4WEBMOnly($fileName) { return array_merge(getVideosURLMP4Only($fileName), getVideosURLWEBMOnly($fileName)); } function getVideosURLOnly($fileName) { $allFiles = getVideosURL_V2($fileName); // disable this function soon foreach ($allFiles as $key => $value) { if ($value['type'] !== 'video') { unset($allFiles[$key]); } } return $allFiles; } $getVideosURL_V2Array = array(); function getVideosURL_V2($fileName, $recreateCache = false) { global $global, $getVideosURL_V2Array; if (empty($fileName)) { return array(); } //$recreateCache = true; $cleanfilename = Video::getCleanFilenameFromFile($fileName); if (!empty($getVideosURL_V2Array[$cleanfilename])) { return $getVideosURL_V2Array[$cleanfilename]; } $pdf = "{$global['systemRootPath']}videos/{$cleanfilename}.pdf"; $mp3 = "{$global['systemRootPath']}videos/{$cleanfilename}.mp3"; if (file_exists($pdf)) { return getVideosURLPDF($fileName); } elseif (file_exists($mp3)) { return getVideosURLAudio($fileName); } $cacheName = "getVideosURL_V2$fileName"; if (empty($recreateCache)) { $lifetime = maxLifetime(); $TimeLog1 = "getVideosURL_V2($fileName) empty recreateCache"; TimeLogStart($TimeLog1); $files = object_to_array(ObjectYPT::getCache($cacheName, $lifetime, true)); if (is_array($files)) { _error_log("getVideosURL_V2: do NOT recreate lifetime = {$lifetime}"); $preg_match_url = addcslashes($global['webSiteRootURL'], "/") . "videos"; foreach ($files as $value) { // check if is a dummy file and the URL still wrong if ( $value['type'] === 'video' && // is a video preg_match("/^{$preg_match_url}/", $value['url']) && // the URL is the same as the main domain filesize($value['path']) < 20) { // file size is small _error_log("getVideosURL_V2:: dummy file found, fix cache " . json_encode(array("/^{$preg_match_url}/", $value['url'], preg_match("/^{$preg_match_url}video/", $value['url']), filesize($value['path']), $value))); unset($files); break; } else { //_error_log("getVideosURL_V2:: NOT dummy file ". json_encode(array("/^{$preg_match_url}video/", $value['url'], preg_match("/^{$preg_match_url}video/", $value['url']),filesize($value['path']),$value))); } } //_error_log("getVideosURL_V2:: cachestill good ". json_encode($files)); } else { //_error_log("getVideosURL_V2:: cache not found ". json_encode($files)); } TimeLogEnd($TimeLog1, __LINE__); } else { _error_log("getVideosURL_V2($fileName) Recreate cache requested " . json_encode(debug_backtrace())); } if (empty($files)) { $files = array(); $plugin = AVideoPlugin::loadPlugin("VideoHLS"); if (!empty($plugin)) { $files = VideoHLS::getSourceFile($fileName); } $video = array('webm', 'mp4'); $audio = array('mp3', 'ogg'); $image = array('jpg', 'gif', 'webp'); $formats = array_merge($video, $audio, $image); //$globQuery = "{$global['systemRootPath']}videos/{$cleanfilename}*.{" . implode(",", $formats) . "}"; //$filesInDir = glob($globQuery, GLOB_BRACE); $filesInDir = globVideosDir($cleanfilename, true); foreach ($filesInDir as $file) { $parts = pathinfo($file); $source = Video::getSourceFile($parts['filename'], ".{$parts['extension']}"); if (empty($source)) { continue; } if (filesize($file) < 20000 && !preg_match("/Dummy File/i", file_get_contents($file))) { continue; } if (preg_match("/{$cleanfilename}(_.+)[.]{$parts['extension']}$/", $file, $matches)) { $resolution = $matches[1]; } else { preg_match('/_([^_]{0,4}).' . $parts['extension'] . '$/', $file, $matches); $resolution = @$matches[1]; } $type = 'video'; if (in_array($parts['extension'], $video)) { $type = 'video'; } elseif (in_array($parts['extension'], $audio)) { $type = 'audio'; } elseif (in_array($parts['extension'], $image)) { $type = 'image'; } $files["{$parts['extension']}{$resolution}"] = array( 'filename' => "{$parts['filename']}.{$parts['extension']}", 'path' => $file, 'url' => $source['url'], 'type' => $type, 'format' => strtolower($parts['extension']), ); } ObjectYPT::setCache($cacheName, $files); } $getVideosURL_V2Array[$cleanfilename] = $files; return $getVideosURL_V2Array[$cleanfilename]; } function getSources($fileName, $returnArray = false, $try = 0) { if ($returnArray) { $videoSources = $audioTracks = $subtitleTracks = array(); } else { $videoSources = $audioTracks = $subtitleTracks = ""; } $video = Video::getVideoFromFileNameLight($fileName); if ($video['type'] !== 'audio' && function_exists('getVRSSources')) { $videoSources = getVRSSources($fileName, $returnArray); } else { //$files = getVideosURL($fileName); $files = getVideosURL_V2($fileName, !empty($try)); $sources = ""; $sourcesArray = array(); foreach ($files as $key => $value) { $path_parts = pathinfo($value['path']); if ($path_parts['extension'] == "webm" || $path_parts['extension'] == "mp4" || $path_parts['extension'] == "m3u8" || $path_parts['extension'] == "mp3" || $path_parts['extension'] == "ogg") { $obj = new stdClass(); $obj->type = mime_content_type_per_filename($value['path']); $sources .= "type}\">"; $obj->src = $value['url']; $sourcesArray[] = $obj; } } $videoSources = $returnArray ? $sourcesArray : $sources; } if (function_exists('getVTTTracks')) { $subtitleTracks = getVTTTracks($fileName, $returnArray); } if ($returnArray) { $return = array_merge($videoSources, $audioTracks, $subtitleTracks); } else { $return = $videoSources . $audioTracks . $subtitleTracks; } $obj = new stdClass(); $obj->result = $return; if (empty($videoSources) && empty($audioTracks) && !empty($video['id']) && $video['type'] == 'video') { if (empty($try)) { //sleep(1); $sources = getSources($fileName, $returnArray, $try + 1); if (!empty($sources)) { Video::updateFilesize($video['id']); } Video::clearCache($video['id']); return $sources; } else { _error_log("getSources($fileName) File not found " . json_encode($video)); $obj = new stdClass(); $obj->type = "video/mp4"; $obj->src = "Video not found"; $obj->label = "Video not found"; $obj->res = 0; $sourcesArray["mp4"] = $obj; $sources["mp4"] = "type}\" label=\"{$obj->label}\" res=\"{$obj->res}\">"; $return = $returnArray ? $sourcesArray : implode(PHP_EOL, $sources); } } return $return; } /** * * @param type $file_src * @return typeget image size with cache */ function getimgsize($file_src) { global $_getimagesize; if (empty($_getimagesize)) { $_getimagesize = array(); } $name = "getimgsize_" . md5($file_src); if (!empty($_getimagesize[$name])) { $size = $_getimagesize[$name]; } else { $cached = ObjectYPT::getCache($name, 86400); //one day if (!empty($cached)) { $c = (Array) $cached; $size = array(); foreach ($c as $key => $value) { if (preg_match("/^[0-9]+$/", $key)) { $key = intval($key); } $size[$key] = $value; } $_getimagesize[$name] = $size; return $size; } $size = @getimagesize($file_src); if (empty($size)) { $size = array(1024, 768); } ObjectYPT::setCache($name, $size); $_getimagesize[$name] = $size; } return $size; } function im_resize($file_src, $file_dest, $wd, $hd, $q = 80) { if (empty($file_dest)) { return false; } if (!file_exists($file_src)) { _error_log("im_resize: Source not found: {$file_src}"); return false; } $size = getimgsize($file_src); if ($size === false) { _error_log("im_resize: Could not get image size: {$file_src}"); return false; } if (empty($size['mime']) || $size['mime'] == 'image/pjpeg') { $size['mime'] = 'image/jpeg'; } $format = strtolower(substr($size['mime'], strpos($size['mime'], '/') + 1)); if (empty($format)) { $format = 'jpeg'; } $destformat = strtolower(substr($file_dest, -4)); if (empty($destformat)) { _error_log("destformat not found {$file_dest}"); $destformat = ".jpg"; } $icfunc = "imagecreatefrom" . $format; if (!function_exists($icfunc)) { _error_log("im_resize: Function does not exists: {$icfunc}"); return false; } $imgSize = getimagesize($file_src); if (empty($imgSize)) { _error_log("im_resize: getimagesize($file_src) return false " . json_encode($imgSize)); return false; } try { $src = $icfunc($file_src); } catch (Exception $exc) { _error_log("im_resize: " . $exc->getMessage()); _error_log("im_resize: Try {$icfunc} from string"); $src = imagecreatefromstring(file_get_contents($file_src)); if (!$src) { _error_log("im_resize: fail {$icfunc} from string"); return false; } } $ws = imagesx($src); $hs = imagesy($src); if ($ws <= $hs) { $hd = ceil(($wd * $hs) / $ws); } else { $wd = ceil(($hd * $ws) / $hs); } if ($ws <= $wd) { $wd = $ws; $hd = $hs; } $wc = ($wd * $hs) / $hd; if ($wc <= $ws) { $hc = ($wc * $hd) / $wd; } else { $hc = ($ws * $hd) / $wd; $wc = ($wd * $hc) / $hd; } $dest = imagecreatetruecolor($wd, $hd); switch ($format) { case "png": imagealphablending($dest, false); imagesavealpha($dest, true); $transparent = imagecolorallocatealpha($dest, 255, 255, 255, 127); imagefilledrectangle($dest, 0, 0, $wd, $hd, $transparent); break; case "gif": // integer representation of the color black (rgb: 0,0,0) $background = imagecolorallocate($src, 0, 0, 0); // removing the black from the placeholder imagecolortransparent($src, $background); break; } imagecopyresampled($dest, $src, 0, 0, ($ws - $wc) / 2, ($hs - $hc) / 2, $wd, $hd, $wc, $hc); $saved = false; if ($destformat == '.png') { $saved = imagepng($dest, $file_dest); } if ($destformat == '.jpg') { $saved = imagejpeg($dest, $file_dest, $q); } if (!$saved) { _error_log('saving failed'); } imagedestroy($dest); imagedestroy($src); @chmod($file_dest, 0666); return true; } function im_resizeV2($file_src, $file_dest, $wd, $hd, $q = 80) { _error_log("im_resizeV2: $file_src, $file_dest, $wd, $hd, $q"); $newImage = im_resize($file_src, $file_dest, $wd, $hd, 100); if (!$newImage) { return false; } $src = imagecreatefromjpeg($file_dest); $ws = imagesx($src); $hs = imagesy($src); if ($ws < $wd) { $dst_x = ($wd - $ws) / 2; } else { $dst_x = 0; } if ($hs < $hd) { $dst_y = ($hd - $hs) / 2; } else { $dst_y = 0; } $mapImage = imagecreatetruecolor($wd, $hd); $bgColor = imagecolorallocate($mapImage, 0, 0, 0); imagefill($mapImage, 0, 0, $bgColor); $tileImg = imagecreatefromjpeg($file_dest); imagecopy($mapImage, $tileImg, $dst_x, $dst_y, 0, 0, $ws, $hs); $saved = imagejpeg($mapImage, $file_dest, $q); return $saved; } function im_resizeV3($file_src, $file_dest, $wd, $hd) { _error_log("im_resizeV3: $file_src, $file_dest, $wd, $hd"); // This tries to preserve the aspect ratio of the thumb while letterboxing it in // The same way that the encoder now does. eval('$ffmpeg ="ffmpeg -i {$file_src} -filter_complex \"scale=(iw*sar)*min({$wd}/(iw*sar)\,{$hd}/ih):ih*min({$wd}/(iw*sar)\,{$hd}/ih), pad={$wd}:{$hd}:({$wd}-iw*min({$wd}/iw\,{$hd}/ih))/2:({$hd}-ih*min({$wd}/iw\,{$hd}/ih))/2\" -sws_flags lanczos -qscale:v 2 {$file_dest}";'); exec($ffmpeg . " < /dev/null 2>&1", $output, $return_val); } function im_resize_max_size($file_src, $file_dest, $max_width, $max_height) { $fn = $file_src; $tmpFile = getTmpFile() . ".jpg"; if (empty($fn)) { _error_log("im_resize_max_size: file name is empty, Destination: {$file_dest}", AVideoLog::$ERROR); return false; } if (function_exists("exif_read_data")) { error_log($fn); convertImage($fn, $tmpFile, 100); $exif = exif_read_data($tmpFile); if ($exif && isset($exif['Orientation'])) { $orientation = $exif['Orientation']; if ($orientation != 1) { $img = imagecreatefromjpeg($tmpFile); $deg = 0; switch ($orientation) { case 3: $deg = 180; break; case 6: $deg = 270; break; case 8: $deg = 90; break; } if ($deg) { $img = imagerotate($img, $deg, 0); } imagejpeg($img, $fn, 100); } } } else { _error_log("Make sure you install the php_mbstring and php_exif to be able to rotate images"); } $size = getimagesize($fn); $ratio = $size[0] / $size[1]; // width/height if ($size[0] <= $max_width && $size[1] <= $max_height) { $width = $size[0]; $height = $size[1]; } elseif ($ratio > 1) { $width = $max_width; $height = $max_height / $ratio; } else { $width = $max_width * $ratio; $height = $max_height; } $src = imagecreatefromstring(file_get_contents($fn)); $dst = imagecreatetruecolor($width, $height); imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]); imagedestroy($src); imagejpeg($dst, $file_dest); // adjust format as needed imagedestroy($dst); @unlink($file_src); @unlink($tmpFile); } function convertImage($originalImage, $outputImage, $quality) { $imagetype = 0; if (function_exists('exif_imagetype')) { $imagetype = exif_imagetype($originalImage); } // jpg, png, gif or bmp? $exploded = explode('.', $originalImage); $ext = $exploded[count($exploded) - 1]; try { if ($imagetype == IMAGETYPE_JPEG || preg_match('/jpg|jpeg/i', $ext)) { $imageTmp = @imagecreatefromjpeg($originalImage); } elseif ($imagetype == IMAGETYPE_PNG || preg_match('/png/i', $ext)) { $imageTmp = imagecreatefrompng($originalImage); } elseif ($imagetype == IMAGETYPE_GIF || preg_match('/gif/i', $ext)) { $imageTmp = imagecreatefromgif($originalImage); } elseif ($imagetype == IMAGETYPE_BMP || preg_match('/bmp/i', $ext)) { $imageTmp = imagecreatefrombmp($originalImage); } elseif ($imagetype == IMAGETYPE_WEBP || preg_match('/webp/i', $ext)) { $imageTmp = imagecreatefromwebp($originalImage); } else { _error_log("convertImage: File Extension not found ($originalImage, $outputImage, $quality) " . exif_imagetype($originalImage)); return 0; } } catch (Exception $exc) { _error_log("convertImage: " . $exc->getMessage()); return 0; } if (!is_resource($imageTmp)) { _error_log("convertImage: could not create a resource $originalImage, $outputImage, $quality"); return 0; } // quality is a value from 0 (worst) to 100 (best) imagejpeg($imageTmp, $outputImage, $quality); imagedestroy($imageTmp); return 1; } function decideMoveUploadedToVideos($tmp_name, $filename, $type = "video") { global $global; $obj = new stdClass(); $aws_s3 = AVideoPlugin::loadPluginIfEnabled('AWS_S3'); $bb_b2 = AVideoPlugin::loadPluginIfEnabled('Blackblaze_B2'); $ftp = AVideoPlugin::loadPluginIfEnabled('FTP_Storage'); $destinationFile = "{$global['systemRootPath']}videos/{$filename}"; _error_log("decideMoveUploadedToVideos: {$filename}"); $path_info = pathinfo($filename); if ($type !== "zip" && $path_info['extension'] === 'zip') { _error_log("decideMoveUploadedToVideos: ZIp file {$filename}"); $dir = "{$global['systemRootPath']}videos/{$path_info['filename']}"; unzipDirectory($tmp_name, $dir); // unzip it cleanDirectory($dir); if (!empty($aws_s3)) { //$aws_s3->move_uploaded_file($tmp_name, $filename); } elseif (!empty($bb_b2)) { $bb_b2->move_uploaded_directory($dir); } elseif (!empty($ftp)) { //$ftp->move_uploaded_file($tmp_name, $filename); } } else { _error_log("decideMoveUploadedToVideos: NOT ZIp file {$filename}"); if (!empty($aws_s3)) { _error_log("decideMoveUploadedToVideos: S3 {$filename}"); $aws_s3->move_uploaded_file($tmp_name, $filename); } elseif (!empty($bb_b2)) { _error_log("decideMoveUploadedToVideos: B2 {$filename}"); $bb_b2->move_uploaded_file($tmp_name, $filename); } elseif (!empty($ftp)) { _error_log("decideMoveUploadedToVideos: FTP {$filename}"); $ftp->move_uploaded_file($tmp_name, $filename); } else { _error_log("decideMoveUploadedToVideos: Local {$filename}"); if (!move_uploaded_file($tmp_name, $destinationFile)) { if (!rename($tmp_name, $destinationFile)) { if (!copy($tmp_name, $destinationFile)) { $obj->msg = "Error on decideMoveUploadedToVideos({$tmp_name}, $destinationFile)"; die(json_encode($obj)); } } } chmod($destinationFile, 0644); } } sleep(1); $fsize = @filesize($destinationFile); _error_log("decideMoveUploadedToVideos: destinationFile {$destinationFile} filesize=" . ($fsize) . " (" . humanFileSize($fsize) . ")"); Video::clearCacheFromFilename($filename); } function unzipDirectory($filename, $destination) { global $global; // Wait a couple of seconds to make sure the file has completed transfer sleep(2); ini_set('memory_limit', '-1'); ini_set('max_execution_time', 7200); // 2 hours $cmd = "unzip {$filename} -d {$destination}" . " 2>&1"; _error_log("unzipDirectory: {$cmd}"); exec($cmd, $output, $return_val); if ($return_val !== 0 && function_exists("zip_open")) { // try to unzip using PHP _error_log("unzipDirectory: TRY to use PHP {$filename}"); $zip = zip_open($filename); if ($zip) { while ($zip_entry = zip_read($zip)) { $path = "{$destination}/" . zip_entry_name($zip_entry); _error_log("unzipDirectory: fopen $path"); if (substr(zip_entry_name($zip_entry), -1) == '/') { make_path($path); } else { make_path($path); $fp = fopen($path, "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp, "$buf"); zip_entry_close($zip_entry); fclose($fp); } } } zip_close($zip); } else { _error_log("unzipDirectory: ERROR php zip does not work"); } } else { _error_log("unzipDirectory: Success {$destination}"); } @unlink($filename); } function make_path($path) { if (substr($path, -1) !== '/') { $path = pathinfo($path, PATHINFO_DIRNAME); } if (!is_dir($path)) { @mkdir($path, 0755, true); } } /** * for security clean all non secure files from directory * @param type $dir * @param type $allowedExtensions * @return type */ function cleanDirectory($dir, $allowedExtensions = array('key', 'm3u8', 'ts', 'vtt', 'jpg', 'gif', 'mp3', 'webm')) { $ffs = scandir($dir); unset($ffs[array_search('.', $ffs, true)]); unset($ffs[array_search('..', $ffs, true)]); // prevent empty ordered elements if (count($ffs) < 1) { return; } foreach ($ffs as $ff) { $current = $dir . '/' . $ff; if (is_dir($current)) { cleanDirectory($current, $allowedExtensions); } $path_parts = pathinfo($current); if (!empty($path_parts['extension']) && !in_array($path_parts['extension'], $allowedExtensions)) { unlink($current); } } } function decideFile_put_contentsToVideos($tmp_name, $filename) { global $global; $aws_s3 = AVideoPlugin::loadPluginIfEnabled('AWS_S3'); $bb_b2 = AVideoPlugin::loadPluginIfEnabled('Blackblaze_B2'); $ftp = AVideoPlugin::loadPluginIfEnabled('FTP_Storage'); if (!empty($bb_b2)) { $bb_b2->move_uploaded_file($tmp_name, $filename); } elseif (!empty($aws_s3)) { $aws_s3->move_uploaded_file($tmp_name, $filename); } elseif (!empty($ftp)) { $ftp->move_uploaded_file($tmp_name, $filename); } else { if (!move_uploaded_file($tmp_name, "{$global['systemRootPath']}videos/{$filename}")) { $obj->msg = "Error on move_uploaded_file({$tmp_name}, {$global['systemRootPath']}videos/{$filename})"; die(json_encode($obj)); } } } if (!function_exists('mime_content_type')) { function mime_content_type($filename) { return mime_content_type_per_filename($filename); } } function fontAwesomeClassName($filename) { $mime_type = mime_content_type_per_filename($filename); // List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml $icon_classes = array( // Media 'image' => 'fas fa-file-image', 'audio' => 'fas fa-file-audio', 'video' => 'fas fa-file-video', // Documents 'application/pdf' => 'fas fa-file-pdf', 'application/msword' => 'fas fa-file-word', 'application/vnd.ms-word' => 'fas fa-file-word', 'application/vnd.oasis.opendocument.text' => 'fas fa-file-word', 'application/vnd.openxmlformats-officedocument.wordprocessingml' => 'fas fa-file-word', 'application/vnd.ms-excel' => 'fas fa-file-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml' => 'fas fa-file-excel', 'application/vnd.oasis.opendocument.spreadsheet' => 'fas fa-file-excel', 'application/vnd.ms-powerpoint' => 'fas fa-file-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml' => 'fas fa-file-powerpoint', 'application/vnd.oasis.opendocument.presentation' => 'fas fa-file-powerpoint', 'text/plain' => 'far fa-file-alt', 'text/html' => 'fas fa-code', 'application/json' => 'fas fa-code', // Archives 'application/gzip' => 'far fa-file-archive', 'application/zip' => 'far fa-file-archive', ); foreach ($icon_classes as $text => $icon) { if (strpos($mime_type, $text) === 0) { return $icon; } } return 'fas fa-file'; } function mime_content_type_per_filename($filename) { $mime_types = array( 'txt' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html', 'php' => 'text/html', 'css' => 'text/css', 'js' => 'application/javascript', 'json' => 'application/json', 'xml' => 'application/xml', 'swf' => 'application/x-shockwave-flash', 'flv' => 'video/x-flv', // images 'png' => 'image/png', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'gif' => 'image/gif', 'bmp' => 'image/bmp', 'ico' => 'image/vnd.microsoft.icon', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'svg' => 'image/svg+xml', 'svgz' => 'image/svg+xml', // archives 'zip' => 'application/zip', 'rar' => 'application/x-rar-compressed', 'exe' => 'application/x-msdownload', 'msi' => 'application/x-msdownload', 'cab' => 'application/vnd.ms-cab-compressed', // audio/video 'mp3' => 'audio/mpeg', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'mp4' => 'video/mp4', 'avi' => 'video/avi', 'mkv' => 'video/mkv', 'wav' => 'audio/wav', 'm4v' => 'video/mpeg', 'webm' => 'video/webm', 'wmv' => 'video/wmv', 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'f4v' => 'video/x-flv', 'm4v' => 'video/m4v', 'm4a' => 'video/quicktime', 'm2p' => 'video/quicktime', 'rm' => 'video/quicktime', 'vob' => 'video/quicktime', 'mkv' => 'video/quicktime', '3gp' => 'video/quicktime', 'm3u8' => 'application/x-mpegURL', // adobe 'pdf' => 'application/pdf', 'psd' => 'image/vnd.adobe.photoshop', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', // ms office 'doc' => 'application/msword', 'rtf' => 'application/rtf', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', // open office 'odt' => 'application/vnd.oasis.opendocument.text', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet' ); if (filter_var($filename, FILTER_VALIDATE_URL) === false) { $ext = pathinfo($filename, PATHINFO_EXTENSION); } else { $ext = pathinfo(parse_url($filename, PHP_URL_PATH), PATHINFO_EXTENSION); } if ($ext === 'mp4' || $ext === 'webm') { $securePlugin = AVideoPlugin::loadPluginIfEnabled('SecureVideosDirectory'); if (!empty($securePlugin)) { if (method_exists($securePlugin, "useEncoderWatrermarkFromFileName") && $securePlugin->useEncoderWatrermarkFromFileName($filename)) { return "application/x-mpegURL"; } } } if (array_key_exists($ext, $mime_types)) { return $mime_types[$ext]; } elseif (function_exists('finfo_open')) { $finfo = finfo_open(FILEINFO_MIME); $mimetype = finfo_file($finfo, $filename); finfo_close($finfo); return $mimetype; } else { return 'application/octet-stream'; } } function combineFiles($filesArray, $extension = "js") { global $global, $advancedCustom; $cacheDir = $global['systemRootPath'] . 'videos/cache/' . $extension . "/"; if (!is_dir($cacheDir)) { mkdir($cacheDir, 0777, true); } $str = ""; $fileName = ""; foreach ($filesArray as $value) { $fileName .= $value; } if ($advancedCustom != false) { $minifyEnabled = $advancedCustom->EnableMinifyJS; } else { $minifyEnabled = false; } // temporary disable minify $minifyEnabled = false; $md5FileName = md5($fileName) . ".{$extension}"; if (!file_exists($cacheDir . $md5FileName)) { foreach ($filesArray as $value) { if (file_exists($global['systemRootPath'] . $value)) { $str .= "\n/*{$value} created local with systemRootPath */\n" . local_get_contents($global['systemRootPath'] . $value); } elseif (file_exists($value)) { $str .= "\n/*{$value} created local with full-path given */\n" . local_get_contents($value); } else { $allowed = ""; if (ini_get('allow_url_fopen')) { $allowed .= "allow_url_fopen is on and "; } if (function_exists('curl_init')) { $allowed .= "curl is on"; } else { $allowed .= "curl is off"; } $content = url_get_contents($value); if (empty($content)) { $allowed .= " - web-fallback 1 (add webSiteRootURL)"; $content = url_get_contents($global['webSiteRootURL'] . $value); } $str .= "\n/*{$value} created via web with own url ({$allowed}) */\n" . $content; } } - if ((($extension == "js" || $extension == "css") && ($minifyEnabled))) { + //if ((($extension == "js" || $extension == "css") && ($minifyEnabled))) { + if ($extension == "css" && ($minifyEnabled)) { require_once $global['systemRootPath'] . 'objects/jshrink.php'; $str = \JShrink\Minifier::minify($str, array('flaggedComments' => false)); } file_put_contents($cacheDir . $md5FileName, $str); } return $global['webSiteRootURL'] . 'videos/cache/' . $extension . "/" . $md5FileName . "?" . filectime($cacheDir . $md5FileName); } function local_get_contents($path) { if (function_exists('fopen')) { $myfile = fopen($path, "r") or die("Unable to open file!"); $text = fread($myfile, filesize($path)); fclose($myfile); return $text; } } function getSelfUserAgent() { global $global, $AVideoStreamer_UA; $agent = $AVideoStreamer_UA . " "; $agent .= parse_url($global['webSiteRootURL'], PHP_URL_HOST); return $agent; } function url_get_contents($url, $ctx = "", $timeout = 0, $debug = false) { global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort; if ($debug) { _error_log("url_get_contents: Start $url, $ctx, $timeout"); } $agent = getSelfUserAgent(); if (empty($ctx)) { $opts = array( 'http' => array('header' => "User-Agent: {$agent}\r\n"), "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, "allow_self_signed" => true, ), ); if (!empty($timeout)) { ini_set('default_socket_timeout', $timeout); $opts['http'] = array('timeout' => $timeout); } $context = stream_context_create($opts); } else { $context = $ctx; } if (ini_get('allow_url_fopen')) { if ($debug) { _error_log("url_get_contents: allow_url_fopen {$url}"); } try { $tmp = @file_get_contents($url, false, $context); if ($tmp != false) { if ($debug) { _error_log("url_get_contents: SUCCESS file_get_contents($url) "); } return remove_utf8_bom($tmp); } if ($debug) { _error_log("url_get_contents: ERROR file_get_contents($url) "); } } catch (ErrorException $e) { if ($debug) { _error_log("url_get_contents: allow_url_fopen ERROR " . $e->getMessage() . " {$url}"); } return "url_get_contents: " . $e->getMessage(); } } elseif (function_exists('curl_init')) { if ($debug) { _error_log("url_get_contents: CURL {$url} "); } $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); if (!empty($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout + 10); } $output = curl_exec($ch); curl_close($ch); if ($debug) { _error_log("url_get_contents: CURL SUCCESS {$url}"); } return remove_utf8_bom($output); } if ($debug) { _error_log("url_get_contents: Nothing yet {$url}"); } // try wget $filename = getTmpDir("YPTurl_get_contents") . md5($url); if ($debug) { _error_log("url_get_contents: try wget $filename {$url}"); } if (wget($url, $filename, $debug)) { if ($debug) { _error_log("url_get_contents: wget success {$url} "); } $result = file_get_contents($filename); unlink($filename); if (!empty($result)) { return remove_utf8_bom($result); } } elseif ($debug) { _error_log("url_get_contents: try wget fail {$url}"); } $result = @file_get_contents($url, false, $context); if ($debug) { _error_log("url_get_contents: Last try {$url}"); } return remove_utf8_bom($result); } function getUpdatesFilesArray() { global $config, $global; if (!class_exists('User') || !User::isAdmin()) { return array(); } $files1 = scandir($global['systemRootPath'] . "updatedb"); $updateFiles = array(); foreach ($files1 as $value) { preg_match("/updateDb.v([0-9.]*).sql/", $value, $match); if (!empty($match)) { if ($config->currentVersionLowerThen($match[1])) { $updateFiles[] = array('filename' => $match[0], 'version' => $match[1]); } } } return $updateFiles; } function thereIsAnyUpdate() { if (!User::isAdmin()) { return false; } $name = 'thereIsAnyUpdate'; if (!isset($_SESSION['user'][$name])) { _session_start(); $_SESSION['user'][$name] = !empty(getUpdatesFilesArray()); } return $_SESSION['user'][$name]; } function thereIsAnyRemoteUpdate() { if (!User::isAdmin()) { return false; } global $config; $version = json_decode(url_get_contents("https://tutorials.avideo.com/version")); $name = 'thereIsAnyRemoteUpdate'; if (!isset($_SESSION['user'][$name])) { if (!empty($version)) { _session_start(); if (version_compare($config->getVersion(), $version->version) === -1) { $_SESSION['user'][$name] = $version; } else { $_SESSION['user'][$name] = false; } } } return $_SESSION['user'][$name]; } function UTF8encode($data) { global $advancedCustom, $global; if (!empty($advancedCustom->utf8Encode)) { return utf8_encode($data); } if (!empty($advancedCustom->utf8Decode)) { return utf8_decode($data); } return $data; } //detect search engine bots function isBot() { if (empty($_SERVER['HTTP_USER_AGENT'])) { return true; } if (isAVideoEncoder()) { return false; } // User lowercase string for comparison. $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); // A list of some common words used only for bots and crawlers. $bot_identifiers = array( 'bot', 'slurp', 'crawler', 'spider', 'curl', 'facebook', 'fetch', 'loader', ); // See if one of the identifiers is in the UA string. foreach ($bot_identifiers as $identifier) { if (strpos($user_agent, $identifier) !== false) { return true; } } return false; } /** * A function that could get me the last N lines of a log file. * @param type $filepath * @param type $lines * @param type $adaptive * @return boolean */ function tail($filepath, $lines = 1, $adaptive = true, $returnArray = false) { if (!function_exists('mb_strlen')) { $msg = "AVideoLog::ERROR you need to install the mb_strlen function to make it work, please the command 'sudo apt install php-mbstring'"; if ($returnArray) { return array(array($msg)); } else { return $msg; } } // Open file $f = @fopen($filepath, "rb"); if ($f === false) { return false; } // Sets buffer size, according to the number of lines to retrieve. // This gives a performance boost when reading a few lines from the file. if (!$adaptive) { $buffer = 4096; } else { $buffer = ($lines < 2 ? 64 : ($lines < 10 ? 512 : 4096)); } // Jump to last character fseek($f, -1, SEEK_END); // Read it and adjust line number if necessary // (Otherwise the result would be wrong if file doesn't end with a blank line) if (fread($f, 1) != "\n") { $lines -= 1; } // Start reading $output = ''; $chunk = ''; // While we would like more while (ftell($f) > 0 && $lines >= 0) { // Figure out how far back we should jump $seek = min(ftell($f), $buffer); // Do the jump (backwards, relative to where we are) fseek($f, -$seek, SEEK_CUR); // Read a chunk and prepend it to our output $output = ($chunk = fread($f, $seek)) . $output; // Jump back to where we started reading fseek($f, -mb_strlen($chunk, '8bit'), SEEK_CUR); // Decrease our line counter $lines -= substr_count($chunk, "\n"); } // While we have too many lines // (Because of buffer size we might have read too many) while ($lines++ < 0) { // Find first newline and remove all text before that $output = substr($output, strpos($output, "\n") + 1); } // Close file and return fclose($f); $output = trim($output); if ($returnArray) { $array = explode("\n", $output); $newArray = array(); foreach ($array as $value) { $newArray[] = array($value); } return $newArray; } else { return $output; } } function encryptPassword($password, $noSalt = false) { global $advancedCustom, $global, $advancedCustomUser; if (!empty($advancedCustomUser->encryptPasswordsWithSalt) && !empty($global['salt']) && empty($noSalt)) { $password .= $global['salt']; } return md5(hash("whirlpool", sha1($password))); } function encryptPasswordVerify($password, $hash, $encodedPass = false) { global $advancedCustom, $global; if (!$encodedPass || $encodedPass === 'false') { //_error_log("encryptPasswordVerify: encrypt"); $passwordSalted = encryptPassword($password); // in case you enable the salt later $passwordUnSalted = encryptPassword($password, true); } else { //_error_log("encryptPasswordVerify: do not encrypt"); $passwordSalted = $password; // in case you enable the salt later $passwordUnSalted = $password; } //_error_log("passwordSalted = $passwordSalted, hash=$hash, passwordUnSalted=$passwordUnSalted"); return $passwordSalted === $hash || $passwordUnSalted === $hash || $password === $hash; } function isMobile() { if (empty($_SERVER["HTTP_USER_AGENT"])) { return false; } global $global; require_once $global['systemRootPath'] . 'objects/Mobile_Detect.php'; $detect = new Mobile_Detect; return $detect->isMobile(); } function isAVideoMobileApp($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return false; } global $AVideoMobileAPP_UA; if (preg_match("/{$AVideoMobileAPP_UA}(.*)/", $_SERVER["HTTP_USER_AGENT"], $match)) { $url = trim($match[1]); if (!empty($url)) { return $url; } return true; } return false; } function isAVideoEncoder($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return false; } global $AVideoEncoder_UA; if (preg_match("/{$AVideoEncoder_UA}(.*)/", $_SERVER["HTTP_USER_AGENT"], $match)) { $url = trim($match[1]); if (!empty($url)) { return $url; } return true; } return false; } function isAVideo($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return false; } global $AVideoEncoder_UA; if (preg_match("/AVideo(.*)/", $_SERVER["HTTP_USER_AGENT"], $match)) { $url = trim($match[1]); if (!empty($url)) { return $url; } return true; } return false; } function isAVideoEncoderOnSameDomain() { $url = isAVideoEncoder(); if (empty($url)) { return false; } $url = "http://{$url}"; return isSameDomainAsMyAVideo($url); } function isSameDomainAsMyAVideo($url) { global $global; if (empty($url)) { return false; } return isSameDomain($url, $global['webSiteRootURL']); } function requestComesFromSameDomainAsMyAVideo() { global $global; $url = ""; if (!empty($_SERVER['HTTP_REFERER'])) { $url = $_SERVER['HTTP_REFERER']; } elseif (!empty($_SERVER['HTTP_ORIGIN'])) { $url = $_SERVER['HTTP_ORIGIN']; } return isSameDomain($url, $global['webSiteRootURL']); } function requestComesFromSafePlace() { return (requestComesFromSameDomainAsMyAVideo() || isAVideo()); } function addGlobalTokenIfSameDomain($url) { if (!filter_var($url, FILTER_VALIDATE_URL) || (empty($_GET['livelink']) || !preg_match("/^http.*/i", $_GET['livelink']))) { return $url; } if (!isSameDomainAsMyAVideo($url)) { return $url; } return addQueryStringParameter($url, 'globalToken', getToken(60)); } /** * Remove a query string parameter from an URL. * * @param string $url * @param string $varname * * @return string */ function removeQueryStringParameter($url, $varname) { $parsedUrl = parse_url($url); $query = array(); if (isset($parsedUrl['query'])) { parse_str($parsedUrl['query'], $query); unset($query[$varname]); } $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; $query = !empty($query) ? '?' . http_build_query($query) : ''; return $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $path . $query; } /** * Add a query string parameter from an URL. * * @param string $url * @param string $varname * * @return string */ function addQueryStringParameter($url, $varname, $value) { $parsedUrl = parse_url($url); $query = array(); if (isset($parsedUrl['query'])) { parse_str($parsedUrl['query'], $query); } $query[$varname] = $value; $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; $query = !empty($query) ? '?' . http_build_query($query) : ''; return $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $path . $query; } function isSameDomain($url1, $url2) { if (empty($url1) || empty($url2)) { return false; } return (get_domain($url1) === get_domain($url2)); } function isAVideoStreamer($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return false; } global $AVideoStreamer_UA; if (preg_match("/{$AVideoStreamer_UA}(.*)/", $_SERVER["HTTP_USER_AGENT"], $match)) { $url = trim($match[1]); if (!empty($url)) { return $url; } return true; } return false; } function isAVideoStorage($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return false; } global $AVideoStorage_UA; if (preg_match("/{$AVideoStorage_UA}(.*)/", $_SERVER["HTTP_USER_AGENT"], $match)) { $url = trim($match[1]); if (!empty($url)) { return $url; } return true; } return false; } function get_domain($url, $ifEmptyReturnSameString = false) { $pieces = parse_url($url); $domain = isset($pieces['host']) ? $pieces['host'] : ''; if (empty($domain)) { return $ifEmptyReturnSameString ? $url : false; } if (preg_match('/(?P[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { return $regs['domain']; } else { $isIp = (bool) ip2long($pieces['host']); if ($isIp) { return $pieces['host']; } } return false; } function siteMap() { _error_log("siteMap: start"); ini_set('memory_limit', '-1'); ini_set('max_execution_time', 0); global $global, $advancedCustom; $date = date('Y-m-d\TH:i:s') . "+00:00"; $xml = ' ' . $global['webSiteRootURL'] . ' ' . $date . ' always 1.00 ' . $global['webSiteRootURL'] . 'help ' . $date . ' monthly 0.50 ' . $global['webSiteRootURL'] . 'about ' . $date . ' monthly 0.50 ' . $global['webSiteRootURL'] . 'contact ' . $date . ' monthly 0.50 ' . $global['webSiteRootURL'] . 'channels ' . $date . ' daily 0.80 '; $_REQUEST['rowCount'] = $advancedCustom->siteMapRowsLimit; _error_log("siteMap: rowCount {$_REQUEST['rowCount']} "); $_POST['sort']['modified'] = "DESC"; $users = User::getAllUsersThatHasVideos(true); _error_log("siteMap: getAllUsers " . count($users)); foreach ($users as $value) { $xml .= ' ' . User::getChannelLink($value['id']) . ' ' . $date . ' daily 0.90 '; } $xml .= ' '; $_REQUEST['rowCount'] = $advancedCustom->siteMapRowsLimit; $_POST['sort']['modified'] = "DESC"; $rows = Category::getAllCategories(); _error_log("siteMap: getAllCategories " . count($rows)); foreach ($rows as $value) { $xml .= ' ' . $global['webSiteRootURL'] . 'cat/' . $value['clean_name'] . ' ' . $date . ' weekly 0.80 '; } $xml .= ''; $_REQUEST['rowCount'] = $advancedCustom->siteMapRowsLimit * 10; $_POST['sort']['created'] = "DESC"; $rows = Video::getAllVideos(!empty($advancedCustom->showPrivateVideosOnSitemap) ? "viewableNotUnlisted" : "publicOnly"); _error_log("siteMap: getAllVideos " . count($rows)); foreach ($rows as $video) { $videos_id = $video['id']; //_error_log("siteMap: getAllVideos videos_id {$videos_id} start"); $source = Video::getSourceFile($video['filename']); if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) { $img = $source['url']; $data = getimgsize($source['path']); $imgw = $data[0]; $imgh = $data[1]; } elseif ($video['type'] == "audio") { $img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg"; } $type = 'video'; if ($video['type'] === 'pdf') { $type = 'pdf'; } if ($video['type'] === 'article') { $type = 'article'; } $images = Video::getImageFromFilename($video['filename'], $type); if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { $img = $images->posterPortrait; $data = getimgsize($images->posterPortraitPath); $imgw = $data[0]; $imgh = $data[1]; } else { $img = $images->poster; } $description = str_replace(array('"', "\n", "\r"), array('', ' ', ' '), empty(trim($video['description'])) ? $video['title'] : $video['description']); $duration = parseDurationToSeconds($video['duration']); if ($duration > 28800) { // this is because this issue https://github.com/WWBN/AVideo/issues/3338 remove in the future if is not necessary anymore $duration = 28800; } $xml .= ' ' . Video::getLink($video['id'], $video['clean_title']) . ' ' . $img . ' ' . str_replace('"', '', $video['title']) . ' ' . htmlentities(parseVideos(Video::getLinkToVideo($videos_id))) . ' ' . $duration . ' ' . $video['views_count'] . ' ' . date("Y-m-d\TH:i:s", strtotime($video['created'])) . '+00:00 yes ' . (Video::isPublic($video['id']) ? "no" : "yes") . ' ' . User::getNameIdentificationById($video['users_id']) . ' no '; } $xml .= ' '; _error_log("siteMap: done "); $newXML1 = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', '', $xml); if (empty($newXML1)) { _error_log("siteMap: pregreplace1 fail "); $newXML1 = $xml; } $newXML2 = preg_replace('/&(?!#?[a-z0-9]+;)/', '&', $newXML1); if (empty($newXML2)) { _error_log("siteMap: pregreplace2 fail "); $newXML2 = $newXML1; } $newXML3 = preg_replace('/[\x00-\x1F\x7F-\xFF]/', '', $newXML2); if (empty($newXML3)) { _error_log("siteMap: pregreplace3 fail "); $newXML3 = $newXML2; } $newXML4 = preg_replace('/[\x00-\x1F\x7F]/', '', $newXML3); if (empty($newXML4)) { _error_log("siteMap: pregreplace4 fail "); $newXML4 = $newXML3; } $newXML5 = preg_replace('/[\x00-\x1F\x7F\xA0]/u', '', $newXML4); if (empty($newXML5)) { _error_log("siteMap: pregreplace5 fail "); $newXML5 = $newXML4; } return $newXML5; } function object_to_array($obj) { //only process if it's an object or array being passed to the function if (is_object($obj) || is_array($obj)) { $ret = (array) $obj; foreach ($ret as &$item) { //recursively process EACH element regardless of type $item = object_to_array($item); } return $ret; } //otherwise (i.e. for scalar values) return without modification else { return $obj; } } function allowOrigin() { global $global; if (empty($_SERVER['HTTP_ORIGIN'])) { $server = parse_url($global['webSiteRootURL']); header('Access-Control-Allow-Origin: ' . $server["scheme"] . '://imasdk.googleapis.com'); } else { header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']); } header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT"); header("Access-Control-Allow-Headers: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); } function rrmdir($dir) { global $global; if ($dir == "{$global['systemRootPath']}videos/" || $dir == "{$global['systemRootPath']}videos") { return false; } if (is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if ($object != "." && $object != "..") { if (is_dir($dir . "/" . $object)) { rrmdir($dir . "/" . $object); } else { unlink($dir . "/" . $object); } } } rmdir($dir); } } /** * You can now configure it on the configuration.php * @return boolean */ function ddosProtection() { global $global; $maxCon = empty($global['ddosMaxConnections']) ? 40 : $global['ddosMaxConnections']; $secondTimeout = empty($global['ddosSecondTimeout']) ? 5 : $global['ddosSecondTimeout']; $whitelistedFiles = array( 'playlists.json.php', 'playlistsFromUserVideos.json.php', 'image404.php' ); if (in_array(basename($_SERVER["SCRIPT_FILENAME"]), $whitelistedFiles)) { return true; } $time = time(); if (!isset($_SESSION['bruteForceBlock']) || empty($_SESSION['bruteForceBlock'])) { $_SESSION['bruteForceBlock'] = array(); $_SESSION['bruteForceBlock'][] = $time; return true; } $_SESSION['bruteForceBlock'][] = $time; //remove requests that are older than secondTimeout foreach ($_SESSION['bruteForceBlock'] as $key => $request_time) { if ($request_time < $time - $secondTimeout) { unset($_SESSION['bruteForceBlock'][$key]); } } //progressive timeout-> more requests, longer timeout $active_connections = count($_SESSION['bruteForceBlock']); $timeoutReal = ($active_connections / $maxCon) < 1 ? 0 : ($active_connections / $maxCon) * $secondTimeout; if ($timeoutReal) { _error_log("ddosProtection:: progressive timeout timeoutReal = ($timeoutReal) active_connections = ($active_connections) maxCon = ($maxCon) ", AVideoLog::$SECURITY); } sleep($timeoutReal); //with strict mode, penalize "attacker" with sleep() above, log and then die if ($global['strictDDOSprotection'] && $timeoutReal > 0) { $str = "bruteForceBlock: maxCon: $maxCon => secondTimeout: $secondTimeout | IP: " . getRealIpAddr() . " | count:" . count($_SESSION['bruteForceBlock']); _error_log($str); die($str); } return true; } function getAdsLeaderBoardBigVideo() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return trim($ad->leaderBoardBigVideoMobile->value); } else { return trim($ad->leaderBoardBigVideo->value); } } } function getAdsLeaderBoardTop() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->leaderBoardTopMobile->value; } else { return $ad->leaderBoardTop->value; } } } function getAdsChannelLeaderBoardTop() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->channelLeaderBoardTopMobile->value; } else { return $ad->channelLeaderBoardTop->value; } } } function getAdsLeaderBoardTop2() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->leaderBoardTopMobile2->value; } else { return $ad->leaderBoardTop2->value; } } } function getAdsLeaderBoardMiddle() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->leaderBoardMiddleMobile->value; } else { return $ad->leaderBoardMiddle->value; } } } function getAdsLeaderBoardFooter() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->leaderBoardFooterMobile->value; } else { return $ad->leaderBoardFooter->value; } } } function getAdsSideRectangle() { $ad = AVideoPlugin::getObjectDataIfEnabled('ADs'); if (!empty($ad)) { if (isMobile()) { return $ad->sideRectangle->value; } else { return $ad->sideRectangle->value; } } } function isToHidePrivateVideos() { $obj = AVideoPlugin::getObjectDataIfEnabled("Gallery"); if (!empty($obj)) { return $obj->hidePrivateVideos; } $obj = AVideoPlugin::getObjectDataIfEnabled("YouPHPFlix2"); if (!empty($obj)) { return $obj->hidePrivateVideos; } $obj = AVideoPlugin::getObjectDataIfEnabled("YouTube"); if (!empty($obj)) { return $obj->hidePrivateVideos; } return false; } function convertImageToOG($source, $destination) { if (!file_exists($destination)) { $w = 200; $h = 200; $sizes = getimagesize($source); if ($sizes[0] < $w || $sizes[1] < $h) { $tmpDir = getTmpDir(); $fileConverted = $tmpDir . "_jpg_" . uniqid() . ".jpg"; convertImage($source, $fileConverted, 100); im_resizeV2($fileConverted, $destination, $w, $h, 100); unlink($fileConverted); } } return $destination; } function convertImageToRoku($source, $destination) { if (empty($source)) { _error_log("convertImageToRoku: source image is empty"); return false; } $w = 1280; $h = 720; if (file_exists($destination)) { $sizes = getimagesize($destination); if ($sizes[0] < $w || $sizes[1] < $h) { _error_log("convertImageToRoku: file is smaller " . json_encode($sizes)); unlink($destination); } } if (!file_exists($destination)) { try { $tmpDir = getTmpDir(); $fileConverted = $tmpDir . "_jpg_" . uniqid() . ".jpg"; convertImage($source, $fileConverted, 100); im_resizeV2($fileConverted, $destination, $w, $h, 100); @unlink($fileConverted); } catch (Exception $exc) { _error_log("convertImageToRoku: " . $exc->getMessage()); return false; } } return $destination; } function ogSite() { global $global, $config; include $global['systemRootPath'] . 'objects/functionogSite.php'; } function getOpenGraph($videos_id) { global $global, $config, $advancedCustom; include $global['systemRootPath'] . 'objects/functiongetOpenGraph.php'; } function getLdJson($videos_id) { $cache = ObjectYPT::getCache("getLdJson{$videos_id}", 0); if (empty($cache)) { echo $cache; } global $global, $config; echo ""; if (empty($videos_id)) { echo ""; if (!empty($_GET['videoName'])) { echo ""; $video = Video::getVideoFromCleanTitle($_GET['videoName']); } } else { echo ""; $video = Video::getVideoLight($videos_id); } if (empty($video)) { echo ""; return false; } $videos_id = $video['id']; $source = Video::getSourceFile($video['filename']); if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) { $img = $source['url']; $data = getimgsize($source['path']); $imgw = $data[0]; $imgh = $data[1]; } elseif ($video['type'] == "audio") { $img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg"; } $type = 'video'; if ($video['type'] === 'pdf') { $type = 'pdf'; } if ($video['type'] === 'article') { $type = 'article'; } $images = Video::getImageFromFilename($video['filename'], $type); if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { $img = $images->posterPortrait; $data = getimgsize($images->posterPortraitPath); $imgw = $data[0]; $imgh = $data[1]; } else { $img = $images->poster; } $description = html2plainText(empty(trim($video['description'])) ? $video['title'] : $video['description']); $duration = Video::getItemPropDuration($video['duration']); if ($duration == "PT0H0M0S") { $duration = "PT0H0M1S"; } $output = ' '; ObjectYPT::setCache("getLdJson{$videos_id}", $output); echo $output; } function getItemprop($videos_id) { $cache = ObjectYPT::getCache("getItemprop{$videos_id}", 0); if (empty($cache)) { echo $cache; } global $global, $config; echo ""; if (empty($videos_id)) { echo ""; if (!empty($_GET['videoName'])) { echo ""; $video = Video::getVideoFromCleanTitle($_GET['videoName']); } } else { echo ""; $video = Video::getVideoLight($videos_id); } if (empty($video)) { echo ""; return false; } $videos_id = $video['id']; $source = Video::getSourceFile($video['filename']); if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) { $img = $source['url']; $data = getimgsize($source['path']); $imgw = $data[0]; $imgh = $data[1]; } elseif ($video['type'] == "audio") { $img = "{$global['webSiteRootURL']}view/img/audio_wave.jpg"; } $type = 'video'; if ($video['type'] === 'pdf') { $type = 'pdf'; } if ($video['type'] === 'image') { $type = 'image'; } if ($video['type'] === 'zip') { $type = 'zip'; } if ($video['type'] === 'article') { $type = 'article'; } $images = Video::getImageFromFilename($video['filename'], $type); if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { $img = $images->posterPortrait; $data = getimgsize($images->posterPortraitPath); $imgw = $data[0]; $imgh = $data[1]; } else { $img = $images->poster; } $description = html2plainText(empty(trim($video['description'])) ? $video['title'] : $video['description']); $duration = Video::getItemPropDuration($video['duration']); if ($duration == "PT0H0M0S") { $duration = "PT0H0M1S"; } $output = ' '; ObjectYPT::setCache("getItemprop{$videos_id}", $output); echo $output; } function getOS($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } $os_platform = "Unknown OS Platform"; $os_array = array( '/windows nt 10/i' => 'Windows 10', '/windows nt 6.3/i' => 'Windows 8.1', '/windows nt 6.2/i' => 'Windows 8', '/windows nt 6.1/i' => 'Windows 7', '/windows nt 6.0/i' => 'Windows Vista', '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', '/windows nt 5.1/i' => 'Windows XP', '/windows xp/i' => 'Windows XP', '/windows nt 5.0/i' => 'Windows 2000', '/windows me/i' => 'Windows ME', '/win98/i' => 'Windows 98', '/win95/i' => 'Windows 95', '/win16/i' => 'Windows 3.11', '/macintosh|mac os x/i' => 'Mac OS X', '/mac_powerpc/i' => 'Mac OS 9', '/linux/i' => 'Linux', '/ubuntu/i' => 'Ubuntu', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'Mobile' ); foreach ($os_array as $regex => $value) { if (preg_match($regex, $user_agent)) { $os_platform = $value; } } return $os_platform; } function get_browser_name($user_agent = "") { if (empty($user_agent)) { $user_agent = @$_SERVER['HTTP_USER_AGENT']; } if (empty($user_agent)) { return 'Unknow'; } // Make case insensitive. $t = strtolower($user_agent); // If the string *starts* with the string, strpos returns 0 (i.e., FALSE). Do a ghetto hack and start with a space. // "[strpos()] may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE." // http://php.net/manual/en/function.strpos.php $t = " " . $t; // Humans / Regular Users if (isAVideoStreamer($t)) { return 'AVideo Mobile App'; } elseif ($url = isAVideoEncoder($t)) { return 'AVideo Encoder ' . $url; } elseif ($url = isAVideoStreamer($t)) { return 'AVideo Streamer ' . $url; } elseif (strpos($t, 'crkey')) { return 'Chromecast'; } elseif (strpos($t, 'opera') || strpos($t, 'opr/')) { return 'Opera'; } elseif (strpos($t, 'edge')) { return 'Edge'; } elseif (strpos($t, 'chrome')) { return 'Chrome'; } elseif (strpos($t, 'safari')) { return 'Safari'; } elseif (strpos($t, 'firefox')) { return 'Firefox'; } elseif (strpos($t, 'msie') || strpos($t, 'trident/7')) { return 'Internet Explorer'; } elseif (strpos($t, 'applecoremedia')) { return 'Native Apple Player'; } // Search Engines elseif (strpos($t, 'google')) { return '[Bot] Googlebot'; } elseif (strpos($t, 'bing')) { return '[Bot] Bingbot'; } elseif (strpos($t, 'slurp')) { return '[Bot] Yahoo! Slurp'; } elseif (strpos($t, 'duckduckgo')) { return '[Bot] DuckDuckBot'; } elseif (strpos($t, 'baidu')) { return '[Bot] Baidu'; } elseif (strpos($t, 'yandex')) { return '[Bot] Yandex'; } elseif (strpos($t, 'sogou')) { return '[Bot] Sogou'; } elseif (strpos($t, 'exabot')) { return '[Bot] Exabot'; } elseif (strpos($t, 'msn')) { return '[Bot] MSN'; } // Common Tools and Bots elseif (strpos($t, 'mj12bot')) { return '[Bot] Majestic'; } elseif (strpos($t, 'ahrefs')) { return '[Bot] Ahrefs'; } elseif (strpos($t, 'semrush')) { return '[Bot] SEMRush'; } elseif (strpos($t, 'rogerbot') || strpos($t, 'dotbot')) { return '[Bot] Moz or OpenSiteExplorer'; } elseif (strpos($t, 'frog') || strpos($t, 'screaming')) { return '[Bot] Screaming Frog'; } // Miscellaneous elseif (strpos($t, 'facebook')) { return '[Bot] Facebook'; } elseif (strpos($t, 'pinterest')) { return '[Bot] Pinterest'; } // Check for strings commonly used in bot user agents elseif (strpos($t, 'crawler') || strpos($t, 'api') || strpos($t, 'spider') || strpos($t, 'http') || strpos($t, 'bot') || strpos($t, 'archive') || strpos($t, 'info') || strpos($t, 'data')) { return '[Bot] Other'; } //_error_log("Unknow user agent ($t) IP=" . getRealIpAddr() . " URI=" . getRequestURI()); return 'Other (Unknown)'; } /** * Due some error on old chrome browsers (version < 70) on decrypt HLS keys with the videojs versions greater then 7.9.7 * we need to detect the chrome browser and load an older version * */ function isOldChromeVersion() { $global; if (empty($_SERVER['HTTP_USER_AGENT'])) { return false; } if (!empty($global['forceOldChrome'])) { return true; } if (preg_match('/Chrome\/([0-9.]+)/i', $_SERVER['HTTP_USER_AGENT'], $matches)) { return version_compare($matches[1], '80', '<='); } return false; } function TimeLogStart($name) { global $global; if (!empty($global['noDebug'])) { return false; } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; if (empty($global['start']) || !is_array($global['start'])) { $global['start'] = array(); } $global['start'][$name] = $time; } function TimeLogEnd($name, $line, $TimeLogLimit = 0.7) { global $global; if (!empty($global['noDebug'])) { return false; } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $global['start'][$name]), 4); if ($total_time > $TimeLogLimit) { _error_log("Warning: Slow process detected [{$name}] On Line {$line} takes {$total_time} seconds to complete, Limit ({$TimeLogLimit}). {$_SERVER["SCRIPT_FILENAME"]}"); } TimeLogStart($name); } class AVideoLog { public static $DEBUG = 0; public static $WARNING = 1; public static $ERROR = 2; public static $SECURITY = 3; } function _error_log($message, $type = 0, $doNotRepeat = false) { if (empty($doNotRepeat)) { // do not log it too many times when you are using HLS format, other wise it will fill the log file with the same error $doNotRepeat = preg_match("/hls.php$/", $_SERVER['SCRIPT_NAME']); } if ($doNotRepeat) { return false; } global $global; if (!empty($global['noDebug']) && $type == 0) { return false; } $prefix = "AVideoLog::"; switch ($type) { case AVideoLog::$DEBUG: $prefix .= "DEBUG: "; break; case AVideoLog::$WARNING: $prefix .= "WARNING: "; break; case AVideoLog::$ERROR: $prefix .= "ERROR: "; break; case AVideoLog::$SECURITY: $prefix .= "SECURITY: "; break; } error_log($prefix . $message . " SCRIPT_NAME: {$_SERVER['SCRIPT_NAME']}"); } function postVariables($url, $array) { if (!$url || !is_string($url) || !preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i', $url)) { return false; } $array = object_to_array($array); $ch = curl_init($url); @curl_setopt($ch, CURLOPT_HEADER, true); // we want headers @curl_setopt($ch, CURLOPT_NOBODY, true); // we don't need body curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $array); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // execute! $response = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // close the connection, release resources used curl_close($ch); if ($httpcode == 200) { return true; } return $httpcode; } function _session_start(array $options = array()) { try { if (session_status() == PHP_SESSION_NONE) { return @session_start($options); } } catch (Exception $exc) { _error_log("_session_start: " . $exc->getTraceAsString()); return false; } } function _mysql_connect() { global $global, $mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, $mysqlPort; if (is_object($global['mysqli']) && empty(@$global['mysqli']->ping())) { try { $global['mysqli'] = new mysqli($mysqlHost, $mysqlUser, $mysqlPass, $mysqlDatabase, @$mysqlPort); if (!empty($global['mysqli_charset'])) { $global['mysqli']->set_charset($global['mysqli_charset']); } } catch (Exception $exc) { _error_log($exc->getTraceAsString()); return false; } } } function _mysql_close() { global $global; if (is_object($global['mysqli']) && !empty(@$global['mysqli']->ping())) { @$global['mysqli']->close(); } } function remove_utf8_bom($text) { if (strlen($text) > 1000000) { return $text; } $bom = pack('H*', 'EFBBBF'); $text = preg_replace("/^$bom/", '', $text); return $text; } function getCacheDir() { $p = AVideoPlugin::loadPlugin("Cache"); return $p->getCacheDir(); } function clearCache() { global $global; $dir = "{$global['systemRootPath']}videos/cache/"; if (!empty($_GET['FirstPage'])) { $dir .= "firstPage/"; } rrmdir($dir); $dir = getCacheDir(); if (!empty($_GET['FirstPage'])) { $dir .= "firstPage/"; } rrmdir($dir); ObjectYPT::deleteCache("getEncoderURL"); } function getUsageFromFilename($filename, $dir = "") { global $global; if (!empty($global['getUsageFromFilename'])) { // manually add this variable in your configuration.php file to not scan your video usage return 0; } if (empty($dir)) { $dir = "{$global['systemRootPath']}videos/"; } $pos = strrpos($dir, '/'); $dir .= (($pos === false) ? "/" : ""); $totalSize = 0; _error_log("getUsageFromFilename: start {$dir}{$filename}"); //$files = glob("{$dir}{$filename}*"); $files = globVideosDir($filename); session_write_close(); $filesProcessed = array(); if (empty($files)) { _error_log("getUsageFromFilename: we did not find any file for {$dir}{$filename}, we will create a fake one"); file_put_contents("{$dir}{$filename}.notfound", time()); $totalSize = 10; } else { foreach ($files as $f) { if (strpos($f, '.size.lock') !== false) { continue; } if (is_dir($f)) { _error_log("getUsageFromFilename: {$f} is Dir"); $dirSize = getDirSize($f); $totalSize += $dirSize; if ($dirSize < 10000 && AVideoPlugin::isEnabledByName('YPTStorage')) { // probably the HLS file is hosted on the YPTStorage $info = YPTStorage::getFileInfo($filename); if (!empty($info->size)) { $totalSize += $info->size; } } } elseif (is_file($f)) { $filesize = filesize($f); if ($filesize < 20) { // that means it is a dummy file $lockFile = $f . ".size.lock"; if (!file_exists($lockFile) || (time() - 600) > filemtime($lockFile)) { file_put_contents($lockFile, time()); _error_log("getUsageFromFilename: {$f} is Dummy file ({$filesize})"); $aws_s3 = AVideoPlugin::loadPluginIfEnabled('AWS_S3'); //$bb_b2 = AVideoPlugin::loadPluginIfEnabled('Blackblaze_B2'); if (!empty($aws_s3)) { _error_log("getUsageFromFilename: Get from S3"); $filesize += $aws_s3->getFilesize($filename); } elseif (!empty($bb_b2)) { // TODO } else { $urls = Video::getVideosPaths($filename, true); _error_log("getUsageFromFilename: Paths " . json_encode($urls)); if (!empty($urls["m3u8"]['url'])) { $filesize += getUsageFromURL($urls["m3u8"]['url']); } if (!empty($urls['mp4'])) { foreach ($urls['mp4'] as $mp4) { if (in_array($mp4, $filesProcessed)) { continue; } $filesProcessed[] = $mp4; $filesize += getUsageFromURL($mp4); } } if (!empty($urls['webm'])) { foreach ($urls['webm'] as $mp4) { if (in_array($mp4, $filesProcessed)) { continue; } $filesProcessed[] = $mp4; $filesize += getUsageFromURL($mp4); } } if (!empty($urls["pdf"]['url'])) { $filesize += getUsageFromURL($urls["pdf"]['url']); } if (!empty($urls["image"]['url'])) { $filesize += getUsageFromURL($urls["image"]['url']); } if (!empty($urls["zip"]['url'])) { $filesize += getUsageFromURL($urls["zip"]['url']); } if (!empty($urls["mp3"]['url'])) { $filesize += getUsageFromURL($urls["mp3"]['url']); } } unlink($lockFile); } } else { _error_log("getUsageFromFilename: {$f} is File ({$filesize})"); } $totalSize += $filesize; } } } return $totalSize; } /** * Returns the size of a file without downloading it, or -1 if the file * size could not be determined. * * @param $url - The location of the remote file to download. Cannot * be null or empty. * * @return The size of the file referenced by $url, or false if the size * could not be determined. */ function getUsageFromURL($url) { global $global; if (!empty($global['doNotGetUsageFromURL'])) { // manually add this variable in your configuration.php file to not scan your video usage return 0; } _error_log("getUsageFromURL: start ({$url})"); // Assume failure. $result = false; $curl = curl_init($url); _error_log("getUsageFromURL: curl_init "); try { // Issue a HEAD request and follow any redirects. curl_setopt($curl, CURLOPT_NOBODY, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); //curl_setopt($curl, CURLOPT_USERAGENT, get_user_agent_string()); $data = curl_exec($curl); } catch (Exception $exc) { echo $exc->getTraceAsString(); _error_log("getUsageFromURL: ERROR " . $exc->getMessage()); _error_log("getUsageFromURL: ERROR " . curl_errno($curl)); _error_log("getUsageFromURL: ERROR " . curl_error($curl)); } if ($data) { _error_log("getUsageFromURL: response header " . $data); $content_length = "unknown"; $status = "unknown"; if (preg_match("/^HTTP\/1\.[01] (\d\d\d)/", $data, $matches)) { $status = (int) $matches[1]; } if (preg_match("/Content-Length: (\d+)/", $data, $matches)) { $content_length = (int) $matches[1]; } // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes if ($status == 200 || ($status > 300 && $status <= 308)) { $result = $content_length; } } else { _error_log("getUsageFromURL: ERROR no response data " . curl_error($curl)); } curl_close($curl); return (int) $result; } function getDirSize($dir) { _error_log("getDirSize: start {$dir}"); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return foldersize($dir); } else { $command = "du -sb {$dir}"; exec($command . " < /dev/null 2>&1", $output, $return_val); if ($return_val !== 0) { _error_log("getDirSize: ERROR ON Command {$command}"); return 0; } else { if (!empty($output[0])) { preg_match("/^([0-9]+).*/", $output[0], $matches); } if (!empty($matches[1])) { _error_log("getDirSize: found {$matches[1]} from - {$output[0]}"); return intval($matches[1]); } _error_log("getDirSize: ERROR on pregmatch {$output[0]}"); return 0; } } } function foldersize($path) { $total_size = 0; $files = scandir($path); $cleanPath = rtrim($path, '/') . '/'; foreach ($files as $t) { if ($t <> "." && $t <> "..") { $currentFile = $cleanPath . $t; if (is_dir($currentFile)) { $size = foldersize($currentFile); $total_size += $size; } else { $size = filesize($currentFile); $total_size += $size; } } } return $total_size; } function getDiskUsage() { global $global; $dir = "{$global['systemRootPath']}videos/"; $obj = new stdClass(); $obj->disk_free_space = disk_free_space($dir); $obj->disk_total_space = disk_total_space($dir); $obj->videos_dir = getDirSize($dir); $obj->disk_used = $obj->disk_total_space - $obj->disk_free_space; $obj->disk_used_by_other = $obj->disk_used - $obj->videos_dir; $obj->disk_free_space_human = humanFileSize($obj->disk_free_space); $obj->disk_total_space_human = humanFileSize($obj->disk_total_space); $obj->videos_dir_human = humanFileSize($obj->videos_dir); $obj->disk_used_human = humanFileSize($obj->disk_used); $obj->disk_used_by_other_human = humanFileSize($obj->disk_used_by_other); // percentage of disk used $obj->disk_used_percentage = sprintf('%.2f', ($obj->disk_used / $obj->disk_total_space) * 100); $obj->videos_dir_used_percentage = sprintf('%.2f', ($obj->videos_dir / $obj->disk_total_space) * 100); $obj->disk_free_space_percentage = sprintf('%.2f', ($obj->disk_free_space / $obj->disk_total_space) * 100); return $obj; } function unsetSearch() { unset($_GET['searchPhrase']); unset($_POST['searchPhrase']); unset($_GET['search']); unset($_GET['q']); } function encrypt_decrypt($string, $action) { global $global; $output = false; $encrypt_method = "AES-256-CBC"; $secret_key = 'This is my secret key'; $secret_iv = $global['systemRootPath']; while (strlen($secret_iv) < 16) { $secret_iv .= $global['systemRootPath']; } // hash $key = hash('sha256', $global['salt']); // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning $iv = substr(hash('sha256', $secret_iv), 0, 16); if ($action == 'encrypt') { $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($output); } elseif ($action == 'decrypt') { $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv); } return $output; } function compressString($string) { if (function_exists("gzdeflate")) { $string = gzdeflate($string, 9); } return $string; } function decompressString($string) { if (function_exists("gzinflate")) { $string = gzinflate($string); } return $string; } function encryptString($string) { if (is_object($string)) { $string = json_encode($string); } return encrypt_decrypt($string, 'encrypt'); } function decryptString($string) { return encrypt_decrypt($string, 'decrypt'); } function getToken($timeout = 0, $salt = "") { global $global; $obj = new stdClass(); $obj->salt = $global['salt'] . $salt; if (!empty($timeout)) { $obj->time = time(); $obj->timeout = $obj->time + $timeout; } else { $obj->time = strtotime("Today 00:00:00"); $obj->timeout = strtotime("Today 23:59:59"); $obj->timeout += cacheExpirationTime(); } $strObj = json_encode($obj); //_error_log("Token created: {$strObj}"); return encryptString($strObj); } function verifyToken($token, $salt = "") { global $global; $obj = json_decode(decryptString($token)); if (empty($obj)) { _error_log("verifyToken invalid token"); return false; } if ($obj->salt !== $global['salt'] . $salt) { _error_log("verifyToken salt fail"); return false; } $time = time(); if (!($time >= $obj->time && $time <= $obj->timeout)) { _error_log("verifyToken token timout time = $time; obj->time = $obj->time; obj->timeout = $obj->timeout"); return false; } return true; } class YPTvideoObject { public $id; public $title; public $description; public $thumbnails; public $channelTitle; public $videoLink; public function __construct($id, $title, $description, $thumbnails, $channelTitle, $videoLink) { $this->id = $id; $this->title = $title; $this->description = $description; $this->thumbnails = $thumbnails; $this->channelTitle = $channelTitle; $this->videoLink = $videoLink; } } function isToShowDuration($type) { $notShowTo = array('pdf', 'article', 'serie', 'zip', 'image'); if (in_array($type, $notShowTo)) { return false; } else { return true; } } function _dieAndLogObject($obj, $prefix = "") { $objString = json_encode($obj); _error_log($prefix . $objString); die($objString); } function isAVideoPlayer() { if (isVideo()) { return true; } return false; } function isVideo() { global $isModeYouTube; return !empty($isModeYouTube) || isPlayList() || isEmbed() || isLive(); } function isAudio() { global $isAudio; return !empty($isAudio); } function isSerie() { return isPlayList(); } function isPlayList() { global $isPlayList, $isSerie; return !empty($isSerie) || !empty($isPlayList); } function isChannel() { global $isChannel; if (!empty($isChannel) && !isVideo()) { $user_id = 0; if (empty($_GET['channelName'])) { if (User::isLogged()) { $user_id = User::getId(); } else { return false; } } else { $_GET['channelName'] = xss_esc($_GET['channelName']); $user = User::getChannelOwner($_GET['channelName']); if (!empty($user)) { $user_id = $user['id']; } else { $user_id = $_GET['channelName']; } } return $user_id; } return false; } function isEmbed() { global $isEmbed; return !empty($isEmbed); } function isLive() { global $isLive; return !empty($isLive); } function isVideoPlayerHasProgressBar() { if (isLive()) { $obj = AVideoPlugin::getObjectData('Live'); if (empty($obj->disableDVR)) { return true; } } elseif (isAVideoPlayer()) { return true; } return false; } function isHLS() { global $video, $global; if (isLive()) { return true; } elseif (!empty($video) && $video['type'] == 'video' && file_exists("{$global['systemRootPath']}videos/{$video['filename']}/index.m3u8")) { return true; } return false; } function getRedirectUri() { if (!empty($_GET['redirectUri'])) { return $_GET['redirectUri']; } if (!empty($_SERVER["HTTP_REFERER"])) { return $_SERVER["HTTP_REFERER"]; } return getRequestURI(); } function getRequestURI() { if (empty($_SERVER['REQUEST_URI'])) { return ""; } return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; } function getSelfURI() { if (empty($_SERVER['PHP_SELF'])) { return ""; } $queryStringWithoutError = preg_replace("/error=[^&]*/", "", $_SERVER['QUERY_STRING']); $phpselfWithoutIndex = preg_replace("/index.php/", "", $_SERVER['PHP_SELF']); $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$phpselfWithoutIndex?$queryStringWithoutError"; $url = rtrim($url, '?'); return $url; } function isSameVideoAsSelfURI($url) { return URLsAreSameVideo($url, getSelfURI()); } function URLsAreSameVideo($url1, $url2) { return getVideoIDFromURL($url1) == getVideoIDFromURL($url2); } function getVideoIDFromURL($url) { if (preg_match("/v=([0-9]+)/", $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/video\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/videoEmbed\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/v\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/vEmbed\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/article\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } if (preg_match('/\/articleEmbed\/([0-9]+)/', $url, $matches)) { return intval($matches[1]); } } function getBackURL() { global $global; $backURL = getRedirectUri(); if (empty($backURL)) { $backURL = getRequestURI(); } if (isSameVideoAsSelfURI($backURL)) { $backURL = getHomeURL(); } return $backURL; } function getHomeURL() { global $global, $advancedCustomUser, $advancedCustom; if (isValidURL($advancedCustomUser->afterLoginGoToURL)) { return $advancedCustomUser->afterLoginGoToURL; } elseif (isValidURL($advancedCustom->logoMenuBarURL) && isSameDomainAsMyAVideo($advancedCustom->logoMenuBarURL)) { return $advancedCustom->logoMenuBarURL; } return $global['webSiteRootURL']; } function isValidURL($url) { if (empty($url) || !is_string($url)) { return false; } if (preg_match("/^http.*/", $url) && filter_var($url, FILTER_VALIDATE_URL)) { return true; } return false; } function hasLastSlash($word) { return substr($word, -1) === '/'; } function addLastSlash($word) { return $word . (hasLastSlash($word) ? "" : "/"); } function URLHasLastSlash() { return hasLastSlash($_SERVER["REQUEST_URI"]); } function getSEOComplement() { $txt = ""; if (!empty($_GET['catName'])) { $txt .= " {$_GET['catName']}"; } if (!empty($_GET['page'])) { $page = intval($_GET['page']); if ($page > 1) { $txt .= " / {$page}"; } } if (!empty($_GET['channelName'])) { $txt .= " {$_GET['channelName']}"; } if (!empty($_GET['type'])) { $txt .= " {$_GET['type']}"; } if (!empty($_GET['showOnly'])) { $txt .= " {$_GET['showOnly']}"; } if (!empty($_GET['error'])) { $txt .= " " . __("Error"); } if (URLHasLastSlash()) { $txt .= "‧"; } if (strrpos($_SERVER['HTTP_HOST'], 'www.') === false) { $txt = "‧{$txt}"; } if (!empty($_GET['error'])) { $txt .= "‧‧"; } return htmlentities(strip_tags($txt)); } function getCurrentPage() { if (!empty($_REQUEST['current'])) { return intval($_REQUEST['current']); } elseif (!empty($_POST['current'])) { return intval($_POST['current']); } elseif (!empty($_GET['current'])) { return intval($_GET['current']); } elseif (isset($_GET['start']) && isset($_GET['length'])) { // for the bootgrid $start = intval($_GET['start']); $length = intval($_GET['length']); if (!empty($start) && !empty($length)) { return floor($start / $length) + 1; } } return 1; } function getRowCount($default = 1000) { global $global; if (!empty($_REQUEST['rowCount'])) { $defaultN = intval($_REQUEST['rowCount']); } elseif (!empty($_POST['rowCount'])) { $defaultN = intval($_POST['rowCount']); } elseif (!empty($_GET['rowCount'])) { $defaultN = intval($_GET['rowCount']); } elseif (!empty($_REQUEST['length'])) { $defaultN = intval($_REQUEST['length']); } elseif (!empty($_POST['length'])) { $defaultN = intval($_POST['length']); } elseif (!empty($_GET['length'])) { $defaultN = intval($_GET['length']); } elseif (!empty($global['rowCount'])) { $defaultN = intval($global['rowCount']); } return (!empty($defaultN) && $defaultN > 0) ? $defaultN : $default; } function getSearchVar() { if (!empty($_REQUEST['search'])) { return $_REQUEST['search']; } elseif (!empty($_REQUEST['q'])) { return $_REQUEST['q']; } if (!empty($_REQUEST['searchPhrase'])) { return $_REQUEST['searchPhrase']; } elseif (!empty($_REQUEST['search']['value'])) { return $_REQUEST['search']['value']; } return ""; } $cleanSearchHistory = ""; function cleanSearchVar() { global $cleanSearchHistory; $search = getSearchVar(); if (!empty($search)) { $cleanSearchHistory = $search; } $searchIdex = array('q', 'searchPhrase', 'search'); foreach ($searchIdex as $value) { unset($_REQUEST[$value]); unset($_POST[$value]); unset($_GET[$value]); } } function reloadSearchVar() { global $cleanSearchHistory; $_REQUEST['search'] = $cleanSearchHistory; if (empty($_GET['search'])) { $_GET['search'] = $cleanSearchHistory; } if (empty($_POST['search'])) { $_POST['search'] = $cleanSearchHistory; } } function wget($url, $filename, $debug = false) { if (empty($url) || $url == "php://input" || !preg_match("/^http/", $url)) { return false; } if (wgetIsLocked($url)) { if ($debug) { _error_log("wget: ERROR the url is already downloading $url, $filename"); } return false; } wgetLock($url); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $content = file_get_contents($url); if (!empty($content) && file_put_contents($filename, $content) > 100) { wgetRemoveLock($url); return true; } wgetRemoveLock($url); return false; } $cmd = "wget --tries=1 {$url} -O {$filename} --no-check-certificate"; if ($debug) { _error_log("wget Start ({$cmd}) "); } //echo $cmd; exec($cmd); wgetRemoveLock($url); if (!file_exists($filename)) { _error_log("wget: ERROR the url does not download $url, $filename"); return false; } if (empty(filesize($filename))) { _error_log("wget: ERROR the url download but is empty $url, $filename"); return true; } return false; } function wgetLockFile($url) { return getTmpDir("YPTWget") . md5($url) . ".lock"; } function wgetLock($url) { $file = wgetLockFile($url); return file_put_contents($file, time() . PHP_EOL, FILE_APPEND | LOCK_EX); } function wgetRemoveLock($url) { $filename = wgetLockFile($url); if (!file_exists($filename)) { return false; } return unlink($filename); } function getLockFile($name) { return getTmpDir("YPTLockFile") . md5($name) . ".lock"; } function setLock($name) { $file = getLockFile($name); return file_put_contents($file, time()); } function isLock($name, $timeout = 60) { $file = getLockFile($name); if (file_exists($file)) { $time = intval(file_get_contents($file)); if ($time + $timeout < time()) { return false; } } } function removeLock($name) { $filename = getLockFile($name); if (!file_exists($filename)) { return false; } return unlink($filename); } function wgetIsLocked($url) { $filename = wgetLockFile($url); if (!file_exists($filename)) { return false; } $time = intval(file_get_contents($filename)); if (time() - $time > 36000) { // more then 10 hours unlink($filename); return false; } return true; } // due the some OS gives a fake is_writable response function isWritable($dir) { $dir = rtrim($dir, '/') . '/'; $file = $dir . uniqid(); $result = false; $time = time(); if (@file_put_contents($file, $time)) { if ($fileTime = @file_get_contents($file)) { if ($fileTime == $time) { $result = true; } } } @unlink($file); return $result; } function _isWritable($dir) { if (!isWritable($dir)) { return false; } $tmpFile = "{$dir}" . uniqid(); $bytes = @file_put_contents($tmpFile, time()); @unlink($tmpFile); return !empty($bytes); } function getTmpDir($subdir = "") { global $global; if (empty($_SESSION['getTmpDir'])) { $_SESSION['getTmpDir'] = array(); } if (empty($_SESSION['getTmpDir'][$subdir . "_"])) { $tmpDir = sys_get_temp_dir(); if (empty($tmpDir) || !_isWritable($tmpDir)) { $tmpDir = "{$global['systemRootPath']}videos/cache/"; } $tmpDir = rtrim($tmpDir, '/') . '/'; $tmpDir = "{$tmpDir}{$subdir}"; $tmpDir = rtrim($tmpDir, '/') . '/'; if (!is_dir($tmpDir)) { mkdir($tmpDir, 0755, true); } _session_start(); $_SESSION['getTmpDir'][$subdir . "_"] = $tmpDir; } else { $tmpDir = $_SESSION['getTmpDir'][$subdir . "_"]; } return $tmpDir; } function getTmpFile() { return getTmpDir("tmpFiles") . uniqid(); } function getMySQLDate() { global $global; $sql = "SELECT now() as time FROM configurations LIMIT 1"; // I had to add this because the about from customize plugin was not loading on the about page http://127.0.0.1/AVideo/about $res = sqlDAL::readSql($sql); $data = sqlDAL::fetchAssoc($res); sqlDAL::close($res); if ($res) { $row = $data['time']; } else { $row = false; } return $row; } function _file_put_contents($filename, $data, $flags = 0, $context = null) { make_path($filename); return file_put_contents($filename, $data, $flags, $context); } function html2plainText($html) { $text = strip_tags($html); $text = str_replace(array('\\', "\n", "\r", '"'), array('', ' ', ' ', ''), trim($text)); return $text; } function getInputPassword($id, $attributes = 'class="form-control"', $paceholder = '') { if (empty($paceholder)) { $paceholder = __("Password"); } ?>
>
>
" . PHP_EOL; } else { return __LINE__; } $object = object_to_array($object); $json = json_encode($object); if (json_last_error()) { echo "Error 1 Found after array conversion: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } $json = json_encode($object, JSON_UNESCAPED_UNICODE); if (json_last_error()) { echo "Error 1 Found with JSON_UNESCAPED_UNICODE: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } $objectEncoded = $object; array_walk_recursive($objectEncoded, function (&$item) { if (is_string($item)) { $item = utf8_encode($item); } }); $json = json_encode($objectEncoded); if (json_last_error()) { echo "Error 2 Found after array conversion: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } $json = json_encode($objectEncoded, JSON_UNESCAPED_UNICODE); if (json_last_error()) { echo "Error 2 Found with JSON_UNESCAPED_UNICODE: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } $objectDecoded = $object; array_walk_recursive($objectDecoded, function (&$item) { if (is_string($item)) { $item = utf8_decode($item); } }); $json = json_encode($objectDecoded); if (json_last_error()) { echo "Error 2 Found after array conversion: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } $json = json_encode($objectDecoded, JSON_UNESCAPED_UNICODE); if (json_last_error()) { echo "Error 2 Found with JSON_UNESCAPED_UNICODE: " . json_last_error_msg() . "
" . PHP_EOL; } else { return __LINE__; } return false; } function _json_encode($object) { if (empty($object)) { return false; } $json = json_encode($object); if (json_last_error()) { _error_log("_json_encode: Error 1 Found: " . json_last_error_msg()); $object = object_to_array($object); $json = json_encode($object); if (json_last_error()) { _error_log("_json_encode: Error 2 Found: " . json_last_error_msg()); $json = json_encode($object, JSON_UNESCAPED_UNICODE); if (json_last_error()) { _error_log("_json_encode: Error 3 Found: " . json_last_error_msg()); $objectEncoded = $object; array_walk_recursive($objectEncoded, function (&$item) { if (is_string($item)) { $item = utf8_encode($item); } }); $json = json_encode($objectEncoded); if (json_last_error()) { _error_log("_json_encode: Error 4 Found: " . json_last_error_msg()); $json = json_encode($objectEncoded, JSON_UNESCAPED_UNICODE); if (json_last_error()) { _error_log("_json_encode: Error 5 Found: " . json_last_error_msg()); $objectDecoded = $object; array_walk_recursive($objectDecoded, function (&$item) { if (is_string($item)) { $item = utf8_decode($item); } }); $json = json_encode($objectDecoded); if (json_last_error()) { _error_log("_json_encode: Error 6 Found: " . json_last_error_msg()); $json = json_encode($objectDecoded, JSON_UNESCAPED_UNICODE); if (json_last_error()) { _error_log("_json_encode: Error 7 Found: " . json_last_error_msg()); } } } } } } } return $json; } // this will make sure the strring will fits in the database field function _substr($string, $start, $length = null) { // make sure the name is not chunked in case of multibyte string if (function_exists("mb_strcut")) { return mb_strcut($string, $start, $length, "UTF-8"); } else { return substr($string, $start, $length); } } function getPagination($total, $page = 0, $link = "", $maxVisible = 10, $infinityScrollGetFromSelector = "", $infinityScrollAppendIntoSelector = "") { global $global, $advancedCustom; if ($total < 2) { return ""; } $uid = md5($link); if ($total < $maxVisible) { $maxVisible = $total; } if (empty($link)) { $link = getSelfURI(); if (preg_match("/(current=[0-9]+)/i", $link, $match)) { $link = str_replace($match[1], "current={page}", $link); } else { $link .= (parse_url($link, PHP_URL_QUERY) ? '&' : '?') . 'current={page}'; } } if (empty($page)) { $page = getCurrentPage(); } $class = ""; if (!empty($infinityScrollGetFromSelector) && !empty($infinityScrollAppendIntoSelector)) { $class = "infiniteScrollPagination{$uid} hidden"; } $pag = ' '; if (!empty($infinityScrollGetFromSelector) && !empty($infinityScrollAppendIntoSelector)) { $content = file_get_contents($global['systemRootPath'] . 'objects/functiongetPagination.php'); $pag .= str_replace( array('$uid', '$webSiteRootURL', '$infinityScrollGetFromSelector', '$infinityScrollAppendIntoSelector'), array($uid, $global['webSiteRootURL'], $infinityScrollGetFromSelector, $infinityScrollAppendIntoSelector), $content ); } return $pag; } function getShareMenu($title, $permaLink, $URLFriendly, $embedURL, $img, $class = "row bgWhite list-group-item menusDiv") { global $global, $advancedCustom; include $global['systemRootPath'] . 'objects/functiongetShareMenu.php'; } function getSharePopupButton($videos_id, $url = "", $title = "") { global $global, $advancedCustom; if ($advancedCustom->disableShareOnly || $advancedCustom->disableShareAndPlaylist) { return false; } $video['id'] = $videos_id; include $global['systemRootPath'] . 'view/include/socialModal.php'; } function forbiddenPage($message, $logMessage = false) { global $global; $_REQUEST['403ErrorMsg'] = $message; if ($logMessage) { _error_log($message); } include $global['systemRootPath'] . 'view/forbiddenPage.php'; exit; } function isForbidden() { global $global; if (!empty($global['isForbidden'])) { return true; } return false; } function diskUsageBars() { global $global; ob_start(); include $global['systemRootPath'] . 'objects/functiondiskUsageBars.php'; $contents = ob_get_contents(); ob_end_clean(); return $contents; } function getDomain() { global $global; if (empty($_SERVER['HTTP_HOST'])) { $parse = parse_url($global['webSiteRootURL']); return $parse['host']; } $domain = $_SERVER['HTTP_HOST']; $domain = str_replace("www.", "", $domain); $domain = preg_match("/^\..+/", $domain) ? ltrim($domain, '.') : $domain; return $domain; } /** * It's separated by time, version, clock_seq_hi, clock_seq_lo, node, as indicated in the followoing rfc. * * From the IETF RFC4122: * 8-4-4-4-12 * @return string */ function getDeviceID() { if (empty($_SERVER['HTTP_USER_AGENT'])) { return "unknowDevice"; } $cookieName = "yptDeviceID"; if (empty($_COOKIE[$cookieName])) { if (empty($_GET[$cookieName])) { $_GET[$cookieName] = uniqidV4(); } if (empty($_SESSION[$cookieName])) { _session_start(); $_SESSION[$cookieName] = $_GET[$cookieName]; } else { $_GET[$cookieName] = $_SESSION[$cookieName]; } if (!_setcookie($cookieName, $_GET[$cookieName], strtotime("+ 1 year"))) { return "getDeviceIDError"; } $_COOKIE[$cookieName] = $_GET[$cookieName]; return $_GET[$cookieName]; } return $_COOKIE[$cookieName]; } function uniqidV4() { $randomString = openssl_random_pseudo_bytes(16); $time_low = bin2hex(substr($randomString, 0, 4)); $time_mid = bin2hex(substr($randomString, 4, 2)); $time_hi_and_version = bin2hex(substr($randomString, 6, 2)); $clock_seq_hi_and_reserved = bin2hex(substr($randomString, 8, 2)); $node = bin2hex(substr($randomString, 10, 6)); /** * Set the four most significant bits (bits 12 through 15) of the * time_hi_and_version field to the 4-bit version number from * Section 4.1.3. * @see http://tools.ietf.org/html/rfc4122#section-4.1.3 */ $time_hi_and_version = hexdec($time_hi_and_version); $time_hi_and_version = $time_hi_and_version >> 4; $time_hi_and_version = $time_hi_and_version | 0x4000; /** * Set the two most significant bits (bits 6 and 7) of the * clock_seq_hi_and_reserved to zero and one, respectively. */ $clock_seq_hi_and_reserved = hexdec($clock_seq_hi_and_reserved); $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2; $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000; return sprintf('%08s-%04s-%04x-%04x-%012s', $time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node); } // guid function _setcookie($cookieName, $value, $expires = 0) { if (empty($expires)) { if (empty($config) || !is_object($config)) { $config = new Configuration(); } $expires = time() + $config->getSession_timeout(); } if (version_compare(phpversion(), '7.3', '>=')) { $cookie_options = array( 'expires' => $expires, 'path' => '/', 'domain' => getDomain(), 'secure' => true, 'httponly' => false, 'samesite' => 'None'); return setcookie($cookieName, $value, $cookie_options); } else { return setcookie($cookieName, $value, (int) $expires, "/", getDomain()); } } function _unsetcookie($cookieName) { $domain = getDomain(); $expires = strtotime("-10 years"); $value = ""; _setcookie($cookieName, $value, $expires); setcookie($cookieName, $value, (int) $expires, "/") && setcookie($cookieName, $value, (int) $expires); setcookie($cookieName, $value, (int) $expires, "/", str_replace("www", "", $domain)); setcookie($cookieName, $value, (int) $expires, "/", "www." . $domain); setcookie($cookieName, $value, (int) $expires, "/", "." . $domain); setcookie($cookieName, $value, (int) $expires, "/", $domain); setcookie($cookieName, $value, (int) $expires, "/"); setcookie($cookieName, $value, (int) $expires); unset($_COOKIE[$cookieName]); } /** * This function is not 100% but try to tell if the site is in an iFrame * @global type $global * @return boolean */ function isIframeInDifferentDomain() { global $global; if (!isIframe()) { return false; } return isSameDomainAsMyAVideo($_SERVER['HTTP_REFERER']); } function isIframe() { global $global; if (isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] === 'iframe') { return true; } if (empty($_SERVER['HTTP_REFERER'])) { return false; } return true; } function getCredentialsURL() { global $global; return "webSiteRootURL=" . urlencode($global['webSiteRootURL']) . "&user=" . urlencode(User::getUserName()) . "&pass=" . urlencode(User::getUserPass()) . "&encodedPass=1"; } function gotToLoginAndComeBackHere($msg) { global $global; if (!empty($_GET['comebackhere'])) { return false; } header("Location: {$global['webSiteRootURL']}user?redirectUri=" . urlencode(getSelfURI()) . "&msg=" . urlencode($msg) . "&comebackhere=1"); exit; } function setAlertMessage($msg, $type = "msg") { _session_start(); $_SESSION['YPTalertMessage'][] = array($msg, $type); } function setToastMessage($msg) { setAlertMessage($msg, "toast"); } function showAlertMessage() { if (!empty($_SESSION['YPTalertMessage'])) { foreach ($_SESSION['YPTalertMessage'] as $value) { if (!empty($value[0])) { if (empty($_GET[$value[1]])) { $_GET[$value[1]] = array(); } $_GET[$value[1]][] = $value[0]; } } _session_start(); unset($_SESSION['YPTalertMessage']); } $joinString = array('error', 'msg', 'success'); foreach ($joinString as $value) { if (!empty($_GET[$value]) && is_array($_GET[$value])) { $_GET[$value] = array_unique($_GET[$value]); $newStr = array(); foreach ($_GET[$value] as $value2) { if (!empty($value2)) { $newStr[] = $value2; } } $_GET[$value] = implode("
", $newStr); } } $check = array('error', 'msg', 'success', 'toast'); foreach ($check as $value) { if (!empty($_GET[$value])) { if (is_array($_GET[$value])) { $newStr = array(); foreach ($_GET[$value] as $key => $value2) { $value2 = str_replace('"', "''", $value2); if (!empty($value2)) { $newStr[] = $value2; } } $_GET[$value] = $newStr; } else { $_GET[$value] = str_replace('"', "''", $_GET[$value]); } } } echo "/** showAlertMessage **/", PHP_EOL; if (!empty($_GET['error'])) { echo 'avideoAlertError("' . $_GET['error'] . '");'; echo 'window.history.pushState({}, document.title, "' . getSelfURI() . '");'; } if (!empty($_GET['msg'])) { echo 'avideoAlertInfo("' . $_GET['msg'] . '");'; echo 'window.history.pushState({}, document.title, "' . getSelfURI() . '");'; } if (!empty($_GET['success'])) { echo 'avideoAlertSuccess("' . $_GET['success'] . '");'; echo 'window.history.pushState({}, document.title, "' . getSelfURI() . '");'; } if (!empty($_GET['toast'])) { if (!is_array($_GET['toast'])) { $_GET['toast'] = array($_GET['toast']); } else { $_GET['toast'] = array_unique($_GET['toast']); } foreach ($_GET['toast'] as $key => $value) { $hideAfter = strlen(strip_tags($value)) * 150; if ($hideAfter < 3000) { $hideAfter = 3000; } if ($hideAfter > 15000) { $hideAfter = 15000; } echo '$.toast({ text: "' . $value . '", hideAfter: ' . $hideAfter . ' // in milli seconds });console.log("Toast Hide after ' . $hideAfter . '");'; } echo 'window.history.pushState({}, document.title, "' . getSelfURI() . '");'; } echo PHP_EOL, "/** showAlertMessage END **/"; } function getResolutionLabel($res) { if ($res == 720) { return "" . getResolutionText($res) . ""; } elseif ($res == 1080) { return "" . getResolutionText($res) . ""; } elseif ($res == 1440) { return "" . getResolutionText($res) . ""; } elseif ($res == 2160) { return "" . getResolutionText($res) . ""; } elseif ($res == 4320) { return "" . getResolutionText($res) . ""; } else { return ''; } } function getResolutionText($res) { if ($res == 720) { return "HD"; } elseif ($res == 1080) { return "FHD"; } elseif ($res == 1440) { return "FHD+"; } elseif ($res == 2160) { return "4K"; } elseif ($res == 4320) { return "8K"; } else { return ''; } } // just realize the readdir is a lot faster then glob function _glob($dir, $pattern) { global $_glob; if (empty($dir)) { return array(); } if (empty($_glob)) { $_glob = array(); } $name = md5($dir . $pattern); if (isset($_glob[$name])) { return $_glob[$name]; } $dir = rtrim($dir, '/') . '/'; $array = array(); if ($handle = opendir($dir)) { $count = 0; while (false !== ($file_name = readdir($handle))) { if (preg_match($pattern, $file_name)) { $array[] = "{$dir}{$file_name}"; } } closedir($handle); } $_glob[$name] = $array; return $array; } function globVideosDir($filename, $filesOnly = false) { global $global; if (empty($filename)) { return array(); } $cleanfilename = Video::getCleanFilenameFromFile($filename); $pattern = "/{$cleanfilename}.*"; if (!empty($filesOnly)) { $formats = getValidFormats(); $pattern .= ".(" . implode("|", $formats) . ")"; } $pattern .= "/"; return _glob("{$global['systemRootPath']}videos/", $pattern); } function getValidFormats() { $video = array('webm', 'mp4', 'm3u8'); $audio = array('mp3', 'ogg'); $image = array('jpg', 'gif', 'webp'); return array_merge($video, $audio, $image); } function isValidFormats($format) { $format = str_replace(".", "", $format); return in_array($format, getValidFormats()); } function getTimerFromDates($startTime, $endTime = 0) { if (!is_int($startTime)) { $startTime = strtotime($startTime); } if (!is_int($endTime)) { $endTime = strtotime($endTime); } if (empty($endTime)) { $endTime = time(); } $timer = abs($endTime - $startTime); $uid = uniqid(); return ""; } function getServerClock() { $id = uniqid(); $today = getdate(); $html = '00:00:00'; $html .= ""; return $html; } /** * Xsendfile and FFMPEG are required for this feature * @global type $global * @param type $filepath * @return boolean */ function downloadHLS($filepath) { global $global; if (!CustomizeUser::canDownloadVideos()) { _error_log("downloadHLS: CustomizeUser::canDownloadVideos said NO"); return false; } if (!file_exists($filepath)) { _error_log("downloadHLS: file NOT found: {$filepath}"); return false; } $videosDir = "{$global['systemRootPath']}videos/"; $outputfilename = str_replace($videosDir, "", $filepath); $parts = explode("/", $outputfilename); $resolution = Video::getResolutionFromFilename($filepath); $outputfilename = $parts[0] . "_{$resolution}_.mp4"; $outputpath = "{$videosDir}cache/downloads/{$outputfilename}"; make_path($outputpath); if (empty($outputfilename)) { _error_log("downloadHLS: empty outputfilename {$outputfilename}"); return false; } if (!empty($_REQUEST['title'])) { $quoted = sprintf('"%s"', addcslashes(basename($_REQUEST['title']), '"\\')); } elseif (!empty($_REQUEST['file'])) { $quoted = sprintf('"%s"', addcslashes(basename($_REQUEST['file']), '"\\')) . ".mp4"; } else { $quoted = $outputfilename; } $filepath = escapeshellcmd($filepath); $outputpath = escapeshellcmd($outputpath); if (true || !file_exists($outputpath)) { $command = get_ffmpeg() . " -allowed_extensions ALL -y -i {$filepath} -c:v copy -c:a copy -bsf:a aac_adtstoasc -strict -2 {$outputpath}"; //var_dump($outputfilename, $command, $_GET, $filepath, $quoted);exit; exec($command . " 2>&1", $output, $return); if (!empty($return)) { _error_log("downloadHLS: " . implode(PHP_EOL, $output)); return false; } } //var_dump($outputfilename, $command, $_GET, $filepath, $quoted);exit; //var_dump($command, $outputpath);exit; header('Content-Description: File Transfer'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("X-Sendfile: {$outputpath}"); exit; } function getSocialModal($videos_id, $url = "", $title = "") { global $global; $video['id'] = $videos_id; $sharingUid = uniqid(); ob_start(); ?> $contents, 'id' => $sharingUid); } function getCroppie( $buttonTitle, $callBackJSFunction, $resultWidth, $resultHeight, $viewportWidth = 0, $boundary = 25, $viewportHeight = 0 ) { global $global; if (empty($viewportWidth)) { $viewportWidth = $resultWidth; } $zoom = 0; if (empty($viewportHeight)) { $zoom = ($viewportWidth / $resultWidth); $viewportHeight = $zoom * $resultHeight; } $boundaryWidth = $viewportWidth + $boundary; $boundaryHeight = $viewportHeight + $boundary; $uid = uniqid(); ob_start(); include $global['systemRootPath'] . 'objects/functionCroppie.php'; $contents = ob_get_contents(); ob_end_clean(); $callBackJSFunction = addcslashes($callBackJSFunction, "'"); return array( "html" => $contents, "id" => "croppie{$uid}", "uploadCropObject" => "uploadCrop{$uid}", "getCroppieFunction" => "getCroppie(uploadCrop{$uid}, '{$callBackJSFunction}', {$resultWidth}, {$resultHeight});", "createCroppie" => "createCroppie{$uid}", "restartCroppie" => "restartCroppie{$uid}" ); } function saveCroppieImage($destination, $postIndex = "imgBase64") { if (empty($_POST[$postIndex])) { return false; } $fileData = base64DataToImage($_POST[$postIndex]); return file_put_contents($destination, $fileData); } function get_ffmpeg($ignoreGPU = false) { global $global; //return 'ffmpeg -user_agent "'.getSelfUserAgent("FFMPEG").'" '; //return 'ffmpeg -headers "User-Agent: '.getSelfUserAgent("FFMPEG").'" '; $ffmpeg = 'ffmpeg '; if (empty($ignoreGPU) && !empty($global['ffmpegGPU'])) { $ffmpeg .= ' --enable-nvenc '; } if (!empty($global['ffmpeg'])) { $ffmpeg = "{$global['ffmpeg']}{$ffmpeg}"; } return $ffmpeg; } function isHTMLPage($url) { if ($type = getHeaderContentTypeFromURL($url)) { if (preg_match('/text\/html/i', $type)) { return true; } } return false; } function getHeaderContentTypeFromURL($url) { if (isValidURL($url) && $type = get_headers($url, 1)["Content-Type"]) { return $type; } return false; } diff --git a/plugin/PlayerSkins/PlayerSkins.php b/plugin/PlayerSkins/PlayerSkins.php index dbe9b599e..e7e16d3cf 100644 --- a/plugin/PlayerSkins/PlayerSkins.php +++ b/plugin/PlayerSkins/PlayerSkins.php @@ -1,405 +1,399 @@ The Skis options are: "; $dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/'; $names = array(); foreach (glob($dir . '*.css') as $file) { $path_parts = pathinfo($file); $names[] = $path_parts['filename']; } return $desc . "" . implode(" or ", $names) . ""; } public function getName() { return "PlayerSkins"; } public function getUUID() { return "e9a568e6-ef61-4dcc-aad0-0109e9be8e36"; } public function getPluginVersion() { return "1.1"; } public function getEmptyDataObject() { global $global; $obj = new stdClass(); $obj->skin = "avideo"; $obj->playbackRates = "[0.5, 1, 1.5, 2]"; $obj->playerCustomDataSetup = ""; $obj->showSocialShareOnEmbed = true; $obj->showLoopButton = true; $obj->showLogo = false; $obj->showShareSocial = true; $obj->showLogoOnEmbed = false; $obj->showLogoAdjustScale = "0.4"; $obj->showLogoAdjustLeft = "-74px"; $obj->showLogoAdjustTop = "-22px;"; $obj->disableEmbedTopInfo = false; $obj->contextMenuDisableEmbedOnly = false; $obj->contextMenuLoop = true; $obj->contextMenuCopyVideoURL = true; $obj->contextMenuCopyVideoURLCurrentTime = true; $obj->contextMenuCopyEmbedCode = true; $obj->contextMenuShare = true; return $obj; } public function getHeadCode() { global $global, $config, $video; $obj = $this->getDataObject(); $css = ""; $js = ""; if (isLive()) { $js .= ""; } if (isVideo() || !empty($_GET['videoName']) || !empty($_GET['u']) || !empty($_GET['evideo']) || !empty($_GET['playlists_id'])) { if (self::isAutoplayEnabled()) { $js .= ""; } else { $js .= ""; } $js .= ""; if (!empty($obj->skin)) { $css .= "skin}.css\" rel=\"stylesheet\" type=\"text/css\"/>"; } if ($obj->showLoopButton && !isLive()) { $css .= ""; } $css .= ""; if ($obj->showLogoOnEmbed && isEmbed() || $obj->showLogo) { $logo = "{$global['webSiteRootURL']}" . $config->getLogo(true); $css .= ""; } if ($obj->showShareSocial && CustomizeUser::canShareVideosFromVideo(@$video['id'])) { $css .= ""; } } $url = urlencode(getSelfURI()); $oembed = ''; $oembed .= ''; return $js . $css . $oembed; } public function getFooterCode() { global $global, $config, $getStartPlayerJSWasRequested, $video, $url, $title; $js = ""; $obj = $this->getDataObject(); if (!empty($_GET['videoName']) || !empty($_GET['u']) || !empty($_GET['evideo']) || !empty($_GET['playlists_id'])) { if (empty($obj->showLoopButton) && empty($playerSkinsObj->contextMenuLoop)) { $js .= ""; } if ($obj->showLogoOnEmbed && isEmbed() || $obj->showLogo) { $title = $config->getWebSiteTitle(); $url = "{$global['webSiteRootURL']}{$config->getLogo(true)}"; $js .= ""; PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayerSkins/logo.js")); //$js .= ""; - - PlayerSkins::getStartPlayerJS("if (player.getChild('controlBar').getChild('PictureInPictureToggle')) { - player.getChild('controlBar').addChild('Logo', {}, getPlayerButtonIndex('PictureInPictureToggle') + 1); -} else { - player.getChild('controlBar').addChild('Logo', {}, getPlayerButtonIndex('fullscreenToggle') - 1); -}"); } if ($obj->showShareSocial && CustomizeUser::canShareVideosFromVideo(@$video['id'])) { $social = getSocialModal($video['id'], @$url, @$title); PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayerSkins/shareButton.js")); //$js .= ""; $js .= $social['html']; $js .= ""; } } if (!empty($getStartPlayerJSWasRequested) || isVideo()) { $js .= ""; $js .= ""; } return $js; } static function getDataSetup($str = "") { global $video, $disableYoutubeIntegration, $global; $obj = AVideoPlugin::getObjectData('PlayerSkins'); $dataSetup = array(); $dataSetup[] = "errorDisplay: false"; if (!isLive() && !empty($obj->playbackRates)) { $dataSetup[] = "'playbackRates':{$obj->playbackRates}"; } if (!isLive() && (isset($_GET['isEmbedded'])) && ($disableYoutubeIntegration == false) && !empty($video['videoLink'])) { if ($_GET['isEmbedded'] == "y") { $dataSetup[] = "techOrder:[\"youtube\"]"; $dataSetup[] = "sources:[{type: \"video/youtube\", src: \"{$video['videoLink']}\"}]"; $dataSetup[] = "youtube:{customVars: {wmode: \"transparent\", origin: \"{$global['webSiteRootURL']}\"}}"; } else if ($_GET['isEmbedded'] == "v") { $dataSetup[] = "techOrder:[\"vimeo\"]"; $dataSetup[] = "sources:[{type: \"video/vimeo\", src: \"{$video['videoLink']}\"}]"; $dataSetup[] = "vimeo:{customVars: {wmode: \"transparent\", origin: \"{$global['webSiteRootURL']}\"}}"; } } $pluginsDataSetup = AVideoPlugin::dataSetup(); if (!empty($pluginsDataSetup)) { $dataSetup[] = $pluginsDataSetup; } if (!empty($dataSetup)) { return ",{" . implode(",", $dataSetup) . "{$str}{$obj->playerCustomDataSetup}}"; } return ""; } // this function was modified, maybe removed in the future static function getStartPlayerJS($onPlayerReady = "", $getDataSetup = "", $noReadyFunction = false) { global $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup; global $getStartPlayerJSWasRequested; self::prepareStartPlayerJS($onPlayerReady, $getDataSetup); $getStartPlayerJSWasRequested = true; //return '/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "' . count($prepareStartPlayerJS_onPlayerReady) . '", $prepareStartPlayerJS_getDataSetup = "' . count($prepareStartPlayerJS_getDataSetup) . '", $onPlayerReady = "' . $onPlayerReady . '", $getDataSetup = "' . $getDataSetup . '" */'; return '/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "' . count($prepareStartPlayerJS_onPlayerReady) . '", $prepareStartPlayerJS_getDataSetup = "' . count($prepareStartPlayerJS_getDataSetup) . '" */'; } static function getStartPlayerJSCode($noReadyFunction = false, $currentTime = 0) { global $config, $global, $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup, $IMAADTag; $obj = AVideoPlugin::getObjectData('PlayerSkins'); $js = ""; if (empty($currentTime) && !isLive()) { $currentTime = self::getCurrentTime(); } if (empty($noReadyFunction)) { $js .= "var originalVideo; " . "$(document).ready(function () {"; } $js .= " originalVideo = $('#mainVideo').clone(); /* prepareStartPlayerJS_onPlayerReady = " . count($prepareStartPlayerJS_onPlayerReady) . ", prepareStartPlayerJS_getDataSetup = " . count($prepareStartPlayerJS_getDataSetup) . " */ if (typeof player === 'undefined') { player = videojs('mainVideo'" . (self::getDataSetup(implode(" ", $prepareStartPlayerJS_getDataSetup))) . "); "; if (!empty($IMAADTag) && !isLive()) { $js .= "var options = {id: 'mainVideo', adTagUrl: '{$IMAADTag}'}; player.ima(options);"; $js .= "setInterval(function(){ fixAdSize(); }, 300); // first time it's clicked. var startEvent = 'click';"; if (isMobile()) { $js .= "// Remove controls from the player on iPad to stop native controls from stealing // our click var contentPlayer = document.getElementById('content_video_html5_api'); if (contentPlayer && (navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i)) && contentPlayer.hasAttribute('controls')) { contentPlayer.removeAttribute('controls'); } // Initialize the ad container when the video player is clicked, but only the if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i)) { startEvent = 'touchend'; }"; } $js .= "player.one(startEvent, function () {player.ima.initializeAdDisplayContainer();});"; } $js .= "} player.ready(function () {"; $js .= "var err = this.error(); if (err && err.code) { $('.vjs-error-display').hide(); $('#mainVideo').find('.vjs-poster').css({'background-image': 'url({$global['webSiteRootURL']}plugin/Live/view/Offline.jpg)'}); } " . implode(PHP_EOL, $prepareStartPlayerJS_onPlayerReady) . " playerPlayIfAutoPlay({$currentTime}); }); player.persistvolume({ namespace: 'AVideo' });"; if ($obj->showLoopButton && !isLive()) { $js .= file_get_contents($global['systemRootPath'] . 'plugin/PlayerSkins/loopbutton.js'); } $js .= file_get_contents($global['systemRootPath'] . 'plugin/PlayerSkins/fixCurrentSources.js'); if (empty($noReadyFunction)) { $js .= "});"; } $getStartPlayerJSWasRequested = true; return $js; } static private function getCurrentTime() { global $video; $currentTime = 0; if (isset($_GET['t'])) { $currentTime = intval($_GET['t']); } else if (!empty ($video['progress']) && !empty($video['progress']['lastVideoTime'])) { $currentTime = intval($video['progress']['lastVideoTime']); $maxCurrentTime = parseDurationToSeconds($video['duration']); if ($maxCurrentTime <= $currentTime + 5) { if (!empty($video['externalOptions']) && !empty($video['externalOptions']->videoStartSeconds)) { $currentTime = intval($video['externalOptions']->videoStartSeconds); } else { $currentTime = 0; } } } else if (!empty($video['externalOptions']) && !empty($video['externalOptions']->videoStartSeconds)) { $currentTime = intval($video['externalOptions']->videoStartSeconds); } return $currentTime; } static function setIMAADTag($tag) { global $IMAADTag; $IMAADTag = $tag; } static function playerJSCodeOnLoad($videos_id, $nextURL = "") { $js = ""; $videos_id = intval($videos_id); if (empty($videos_id)) { return false; } $video = new Video("", "", $videos_id); if (empty($nextURL)) { $next_video = Video::getVideo($video->getNext_videos_id()); if (!empty($next_video['id'])) { $nextURL = Video::getURLFriendly($next_video['id'], isEmbed()); } } $url = Video::getURLFriendly($videos_id); $js .= " player.on('play', function () { addView({$videos_id}, this.currentTime()); }); player.on('timeupdate', function () { var time = Math.round(this.currentTime()); var url = '{$url}'; if (url.indexOf('?') > -1) { url += '&t=' + time; } else { url += '?t=' + time; } $('#linkCurrentTime, .linkCurrentTime').val(url); if (time >= 5 && time % 5 === 0) { addView({$videos_id}, time); } }); player.on('ended', function () { var time = Math.round(this.currentTime()); addView({$videos_id}, time); });"; if (!empty($nextURL)) { $js .= "playNextURL = '{$nextURL}';"; $js .= "player.on('ended', function () {setTimeout(function(){playNext(playNextURL);},playerHasAds()?2000:500);});"; } self::getStartPlayerJS($js); return true; } static private function prepareStartPlayerJS($onPlayerReady = "", $getDataSetup = "") { global $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup; if (empty($prepareStartPlayerJS_onPlayerReady)) { $prepareStartPlayerJS_onPlayerReady = array(); } if (empty($prepareStartPlayerJS_getDataSetup)) { $prepareStartPlayerJS_getDataSetup = array(); } if (!empty($onPlayerReady)) { $prepareStartPlayerJS_onPlayerReady[] = $onPlayerReady; } if (!empty($getDataSetup)) { $prepareStartPlayerJS_getDataSetup[] = $getDataSetup; } } static function isAutoplayEnabled() { global $config; if (isLive()) { return true; } if (!empty($_COOKIE['autoplay'])) { if (strtolower($_COOKIE['autoplay']) === 'false') { return false; } else { return true; } } return $config->getAutoplay(); } public static function getVideoTags($videos_id) { if (empty($videos_id)) { return array(); } $name = "PlayeSkins_getVideoTags{$videos_id}"; $tags = ObjectYPT::getCache($name, 0); if (empty($tags)) { //_error_log("Cache not found $name"); $video = new Video("", "", $videos_id); $fileName = $video->getFilename(); $resolution = Video::getHigestResolution($fileName); $obj = new stdClass(); if (empty($resolution) || empty($resolution['resolution_text'])) { $obj->label = ''; $obj->type = ""; $obj->text = ""; } else { $obj->label = 'Plugin'; $obj->type = "danger"; $obj->text = $resolution['resolution_text']; } $tags = $obj; ObjectYPT::setCache($name, $tags); } return array($tags); } } diff --git a/plugin/PlayerSkins/logo.js b/plugin/PlayerSkins/logo.js index a08909a1c..0894867c1 100644 --- a/plugin/PlayerSkins/logo.js +++ b/plugin/PlayerSkins/logo.js @@ -1,18 +1,23 @@ $(document).ready(function () { var Button = videojs.getComponent('Button'); var Logo = videojs.extend(Button, { //constructor: function(player, options) { constructor: function () { Button.apply(this, arguments); this.addClass('player-logo'); this.controlText(PlayerSkinLogoTitle); }, handleClick: function () { window.open(webSiteRootURL, '_blank'); } }); videojs.registerComponent('Logo', Logo); + if (player.getChild('controlBar').getChild('PictureInPictureToggle')) { + player.getChild('controlBar').addChild('Logo', {}, getPlayerButtonIndex('PictureInPictureToggle') + 1); + } else { + player.getChild('controlBar').addChild('Logo', {}, getPlayerButtonIndex('fullscreenToggle') - 1); + } }); \ No newline at end of file diff --git a/plugin/SeekButton/seek.css b/plugin/SeekButton/seek.css index 6e99cf370..a2fa49e2c 100644 --- a/plugin/SeekButton/seek.css +++ b/plugin/SeekButton/seek.css @@ -1,40 +1,41 @@ #forwardLayer, #backLayer{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-box-align:center; -webkit-box-pack:center; display:-webkit-box; z-index: 9999; } #forwardLayer i, #backLayer i{ transition: all 1s ease; } #forwardLayer i{ position: absolute; right: 100px; } #backLayer i{ position: absolute; left: 100px; } #forwardLayer i.active{ right: 20px; } #backLayer i.active{ left: 20px; } #seekBG{ height: 100%; width: 100%; - background-size: cover; + background-size: contain; + background-position-y: center; background-repeat: no-repeat; background-image: url(seekBG.png); position: absolute; top: 0; display: none; } .vjs-paused #seekBG{ display: block; } \ No newline at end of file diff --git a/plugin/YouPHPFlix2/view/BigVideo.php b/plugin/YouPHPFlix2/view/BigVideo.php index e2bb4ac03..0d3277e18 100644 --- a/plugin/YouPHPFlix2/view/BigVideo.php +++ b/plugin/YouPHPFlix2/view/BigVideo.php @@ -1,83 +1,83 @@ BigVideo && empty($_GET['showOnly'])) { if (empty($video)) { ?>
thumbsGif; $poster = $images->poster; $canWatchPlayButton = ""; $get = $_GET; - if (User::canWatchVideoWithAds($video['id'])) { + if (User::canWatchVideoWithAds($video['id']) && !Video::isSerie($video['id'])) { $canWatchPlayButton = "canWatchPlayButton"; } $_GET = $get; ?>
landscapePosters)) { $landscape = "landscapeTile"; if (!empty($obj->titleLabel)) { $css = "height: 185px;"; } } $get = $_GET; $post = $_POST; $timeLog3 = __FILE__ . " - modeFlix Row"; TimeLogStart($timeLog3); ?> thumbsGif; $img = $images->thumbsJpg; $poster = $images->poster; $canWatchPlayButton = ""; - if (User::canWatchVideoWithAds($value['id'])) { + if (User::canWatchVideoWithAds($value['id']) && !Video::isSerie($value['id'])) { $canWatchPlayButton = "canWatchPlayButton"; } ?>

IMDb doNotDisplayViews)) { ?> doNotDisplayLikes)) { ?> doNotDisplayCategory)) { ?> "> doNotDisplayGroupsTags)) { if ($value2->label === __("Group")) { ?> text; ?> paidOnlyFreeLabel && !empty($value2->label) && $value2->label === __("Paid Content")) { ?>text; ?>doNotDisplayPluginsTags)) { if ($value2->label === "Plugin") { ?> text; ?> showNotRatedLabel) { include $global['systemRootPath'] . 'view/rrating/notRated.php'; } ?>

posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { ?> poster) && basename($images->poster) !== 'notfound.jpg' && basename($images->poster) !== 'pdf.png' && basename($images->poster) !== 'article.png') { ?> landscapePosters) && !empty($images->posterPortrait)) { ?>

.bootgrid-table td { -ms-text-overflow: initial; -o-text-overflow: initial; text-overflow: initial; } .viewsDetails{ color: #FFF; } .viewsDetails:hover{ color: #AAF; } .progress-bar { -webkit-transition: width 2.5s ease; transition: width 2.5s ease; } .modal-dialog { width: 90%; } body{ padding: 0; } footer{ display: none; } #actionButtonsVideoManager button{ font-size: 12px; } .controls .btn{ margin: 5px 0; } #grid .tagsInfo span.label:not(.tagTitle){ display: inline-block; width: 70%; text-align: left; border-top-left-radius: 0; border-bottom-left-radius: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } #grid .tagsInfo span.label.tagTitle{ display: inline-block; width: 30%; overflow: hidden; text-align: right; border-top-right-radius: 0; border-bottom-right-radius: 0; border-top-left-radius: 0.25em; border-bottom-left-radius: 0.25em; } .titleBtn { white-space: break-spaces; display: flex; display: flow-root; }
doNotShowEncoderButton)) { if (!empty($config->getEncoderURL())) { } ?>
doNotShowUploadMP4Button)) { ?> doNotShowEmbedButton)) { ?>
$secondsTotal) { $percent = intval($secondsTotal / $secondsLimit * 100); } else { $percent = 100; } ?> and you have minutes of storage
% of your storage limit used
getDisable_youtubeupload()) { ?> userCanNotChangeCategory) || User::isAdmin()) { ?> userCanNotChangeUserGroup) || User::isAdmin()) { ?> disableVideoSwap) && (empty($advancedCustom->makeSwapVideosOnlyForAdmin) || User::isAdmin())) { ?>
'); ?> '); ?> '); ?>
disableDownloadVideosList)) { ?> getDisable_youtubeupload())) { ?>
-

Let us upload your video to YouTube

-

Before you start

+

+

:

  1. - Enable Google Login and get your google ID and Key + + " . __("Google ID and Key") . ""; ?>
  2. - Go to https://console.developers.google.com - on dashboard Enable YouTube Data API v3 + + + " . __("YouTube Data API") . " v3"; ?>
  3. - In credentials authorized this redirect URIs objects/youtubeUpload.json.php + : + objects/youtubeUpload.json.php
  4. - You can find more help on https://developers.google.com/youtube/v3/getting-started + : +
disableHTMLDescription)) { ?>